Created
April 10, 2017 08:15
-
-
Save wdog/3d0d9661bd213e8ccdfdfa15c76a086b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(new THead) | |
->setComponents([ | |
(new FiltersRow) | |
->addComponents([ | |
(new Filter((new FilterConfig())->setOperator(FilterConfig::OPERATOR_EQ))) | |
->setName('d_doc') | |
->setTemplate('*.components.filters.datetime_picker') | |
->setRenderSection('filters_row_column_d_doc') | |
->setFilteringFunc(function ($val, EloquentDataProvider $provider) { | |
$date = Carbon::createFromFormat('d/m/Y', $val)->toDateString(); | |
$provider->getBuilder()->where('d_doc', '=', $date); | |
}), | |
]), | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** @var Nayjest\Grids\Components\Filter $component */ | |
$id = uniqid(); | |
?> | |
<?php if ($component->getLabel()): ?> | |
<span><?= $component->getLabel() ?></span> | |
<?php endif ?> | |
<input | |
class="form-control input-sm" | |
style="display: inline; width: 85px; margin-right: 10px" | |
name="<?= $component->getInputName() ?>" | |
type="text" | |
value="<?= $component->getValue() ?>" | |
id="<?= $id ?>" | |
> | |
<script> | |
$(function () { | |
// DATES | |
// https://github.com/xdan/datetimepicker | |
jQuery.datetimepicker.setLocale('it'); | |
var opts = { | |
timepicker: false, | |
format: 'd/m/Y', | |
} | |
$('#<?= $id ?>').datetimepicker(opts); | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment