kartik-v / yii2-date-range Goto Github PK
View Code? Open in Web Editor NEWA Date Range Picker for Bootstrap useful for reports and filtering.
Home Page: http://demos.krajee.com/date-range
License: Other
A Date Range Picker for Bootstrap useful for reports and filtering.
Home Page: http://demos.krajee.com/date-range
License: Other
The current latest releaseis v2.0.8. Look Layout changes.
Hi, I'm finding the JS assets are rendered in the wrong order when using FILTER_DATE_RANGE column in your GridView - can't see why this is happening after a good look at the code and comparing to DatePicker code flow for asset registration
Latest version of everything.
CustomGridView extends Kartik GridView
class CustomGridView extends \kartik\grid\GridView{
public function init()
{
parent::init();
$this->export = false;
}
public function run(){
return parent::run();
}
public function registerAssets()
{
parent::registerAssets();
}
}
View filter snippet
<?php \yii\widgets\Pjax::begin(['linkSelector' => '[data-sort],[data-page]']); ?>
<?= CustomGridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel, 'showHeader' => $showHeader,
'filterPosition' => $filterPosition,
'formatter' => ['class' => 'yii\i18n\Formatter', 'nullDisplay' => ''],
'columns' => $columns
]); ?>
<?php \yii\widgets\Pjax::end(); ?>
columns snippet:
[
'filterType'=>CustomGridView::FILTER_DATE_RANGE,
'attribute' => 'search_date',
'label' => 'Date',
'headerOptions' => ['class' => 'pager-date-column'],
'format' => 'date',
'filterWidgetOptions'=>[
'pluginOptions' => [
]
]
],
Rendered page JS, yii.gridView.js is included before jquery.js, no yii.js
<script src="/assets/b90ee649/yii.gridView.js?v=1431288587"></script>
<script src="/assets/84597792/js/daterangepicker.js?v=1435631484"></script>
<script src="/assets/7329f298/jquery.pjax.js?v=1432264189"></script>
<script src="/assets/65a6fa36/jquery.js?v=1430236984"></script>
<script src="/assets/cf374a95/jquery-ui.js?v=1432264189"></script>
<script src="/assets/e97f2b3/js/bootstrap.js?v=1434471202"></script>
<script src="/assets/768646cf/jquery.slimscroll.js?v=1432264189"></script>
<script src="/assets/57a98a69/js/app.js?v=1432264194"></script>
<script src="/assets/3ae58f8a/dist/html5shiv.min.js?v=1432264189"></script>
<script src="/assets/89aab66e/fuelux/js/fuelux.min.js?v=1432264193"></script>
<script src="http://men.dev//js/lodash.min.js?v=1432264186"></script>
<script src="http://men.dev//js/moment.min.js?v=1432264186"></script>
<script src="http://men.dev//js/bootbox.min.js?v=1432264186"></script>
<script src="http://men.dev//js/app.js?v=1436432407"></script>
<script src="http://men.dev//js/plugins.js?v=1435692606"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/q.js/1.2.0/q.min.js"></script>
<script src="/assets/ca468c97/subscription_dashboard.js?v=1433899806"></script>
<script src="/assets/9a1b013d/admin.js?v=1435875900"></script>
<script type="text/javascript">window.App.currentUser ={ id: 1 };</script>
<script type="text/javascript">jQuery(document).ready(function () {
jQuery('#w1').yiiGridView({"filterUrl":"\/admin\/user\/2\/subscriptions\/1\/transactions","filterSelector":"#w1-filters input, #w1-filters select"});
jQuery("#subscriptiontransactionsearch-search_date").daterangepicker(daterangepicker_2bc54c98);
Works fine for FILTER_DATE
[
'filterType'=>CustomGridView::FILTER_DATE,
'attribute' => 'search_date',
'label' => 'Date',
'headerOptions' => ['class' => 'pager-date-column'],
'format' => 'date',
'filterWidgetOptions'=>[
'pluginOptions' => [
]
]
],
Correct JS order
</script><script src="/assets/65a6fa36/jquery.js?v=1430236984"></script>
<script src="/assets/b90ee649/yii.js?v=1431288587"></script>
<script src="/assets/b90ee649/yii.gridView.js?v=1431288587"></script>
<script src="/assets/4b3889f0/js/bootstrap-datepicker.js?v=1435632223"></script>
<script src="/assets/4b3889f0/js/datepicker-kv.js?v=1435632223"></script>
<script src="/assets/7329f298/jquery.pjax.js?v=1432264189"></script>
<script src="/assets/cf374a95/jquery-ui.js?v=1432264189"></script>
<script src="/assets/e97f2b3/js/bootstrap.js?v=1434471202"></script>
<script src="/assets/768646cf/jquery.slimscroll.js?v=1432264189"></script>
<script src="/assets/57a98a69/js/app.js?v=1432264194"></script>
<script src="/assets/3ae58f8a/dist/html5shiv.min.js?v=1432264189"></script>
<script src="/assets/89aab66e/fuelux/js/fuelux.min.js?v=1432264193"></script>
<script src="http://men.dev//js/lodash.min.js?v=1432264186"></script>
<script src="http://men.dev//js/moment.min.js?v=1432264186"></script>
<script src="http://men.dev//js/bootbox.min.js?v=1432264186"></script>
<script src="http://men.dev//js/app.js?v=1436432407"></script>
<script src="http://men.dev//js/plugins.js?v=1435692606"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/q.js/1.2.0/q.min.js"></script>
<script src="/assets/ca468c97/subscription_dashboard.js?v=1433899806"></script>
<script src="/assets/9a1b013d/admin.js?v=1435875900"></script>
<script type="text/javascript">window.App.currentUser ={ id: 1 };</script>
<script type="text/javascript">jQuery(document).ready(function () {
jQuery('#w1').yiiGridView({"filterUrl":"\/admin\/user\/2\/subscriptions\/1\/transactions","filterSelector":"#w1-filters input, #w1-filters select"});
jQuery('#subscriptiontransactionsearch-search_date').parent().kvDatepicker(kvDatepicker_00000000);
I has error:
Uncaught TypeError: moment.weekdaysStart is not a function(anonymous function)
at 237 DateRangePicker.php
please fix it.
It is impossible to overwrite $this->pluginOptions['ranges'] options. There should be range value check:
right now there is:
$this->pluginOptions['ranges'] = [
Yii::t('kvdrp', "Today") => ["moment().startOf('day')", "moment()"],
Yii::t('kvdrp', "Yesterday") => [
"moment().startOf('day').subtract(1,'days')",
"moment().endOf('day').subtract(1,'days')"
],
Yii::t('kvdrp', "Last {n} Days", ['n' => 7]) => [
"moment().startOf('day').subtract(6, 'days')",
"moment()"
],
Yii::t('kvdrp', "Last {n} Days", ['n' => 30]) => [
"moment().startOf('day').subtract(29, 'days')",
"moment()"
],
Yii::t('kvdrp', "This Month") => ["moment().startOf('month')", "moment().endOf('month')"],
Yii::t('kvdrp', "Last Month") => [
"moment().subtract(1, 'month').startOf('month')",
"moment().subtract(1, 'month').endOf('month')"
],
];
should be:
if(!isset($this->pluginOptions['ranges'])){
$this->pluginOptions['ranges'] = [
Yii::t('kvdrp', "Today") => ["moment().startOf('day')", "moment()"],
Yii::t('kvdrp', "Yesterday") => [
"moment().startOf('day').subtract(1,'days')",
"moment().endOf('day').subtract(1,'days')"
],
Yii::t('kvdrp', "Last {n} Days", ['n' => 7]) => [
"moment().startOf('day').subtract(6, 'days')",
"moment()"
],
Yii::t('kvdrp', "Last {n} Days", ['n' => 30]) => [
"moment().startOf('day').subtract(29, 'days')",
"moment()"
],
Yii::t('kvdrp', "This Month") => ["moment().startOf('month')", "moment().endOf('month')"],
Yii::t('kvdrp', "Last Month") => [
"moment().subtract(1, 'month').startOf('month')",
"moment().subtract(1, 'month').endOf('month')"
],
];
}
After last update I've got an error:
Can't use method return value in write context
1. in /projects/php/project1/vendor/kartik-v/yii2-date-range/DateRangePicker.php at line 480
471472473474475476477478479480481482483484485486487488489
/**
* Generates and returns the client script on date range change, when the start and end attributes are set
*
* @param string $type whether `start` or `end`
*
* @return string
*/
protected function getRangeJs($type = '')
{
if (empty($this->getRangeAttr($type))) {
return '';
}
$options = $this->getInputOpts($type);
$input = "jQuery('#" . $this->options['id'] . "')";
return "var v={$input}.val() ? {$type}.format('{$this->_format}') : '';jQuery('#" . $options['id'] .
"').val(v).trigger('change');";
}
/**
The problem due to the fact that since php 5.5, function is invalid value for empty() function:
Note:
Prior to PHP 5.5, empty() only supports variables; anything else will result in a parse error. In other words, the following will not work: empty(trim($name)). Instead, use trim($name) == false.
Please change getRangeJs() in DateRangePicker.php
From:
protected function getRangeJs($type = '')
{
if (empty($this->getRangeAttr($type))) {
return '';
}
$options = $this->getInputOpts($type);
$input = "jQuery('#" . $this->options['id'] . "')";
return "var v={$input}.val() ? {$type}.format('{$this->_format}') : '';jQuery('#" . $options['id'] .
"').val(v).trigger('change');";
}
To:
protected function getRangeJs($type = '')
{
$rangeAttr = $this->getRangeAttr($type);
if (empty($rangeAttr)) {
return '';
}
$options = $this->getInputOpts($type);
$input = "jQuery('#" . $this->options['id'] . "')";
return "var v={$input}.val() ? {$type}.format('{$this->_format}') : '';jQuery('#" . $options['id'] .
"').val(v).trigger('change');";
}
return [
'Apply' => 'Sisesta',
'Cancel' => 'Tühista',
'Custom Range' => 'Vaba valik',
'From' => 'Alates',
'Last Month' => 'Eelmine kuu',
'Last {n} Days' => 'Viimased {n} päeva',
'Select Date Range' => 'Vali kuupäevade vahemik',
'This Month' => 'Käesolev kuu',
'To' => 'Kuni',
'Today' => 'Täna',
'W' => 'N',
'Yesterday' => 'Eile',
];
Hello
I am using the DateRangePicker widget in an activeform, working great except when I want to display the ranges while still displaying the calendars. The setting "alwaysShowCalendars" doesn't have any effect.
This example is working as expected displaying the calendars and no ranges:
<?php
echo $form->field( $model, 'date_range', [
'options' => [ 'class'=>'form-group', 'autocomplete' => 'off' ]
] )->widget( DateRangePicker::classname(), [
] );
?>
This example is not working as expected, only displaying the ranges, the "alwaysShowCalendars" setting should force calendars to be displayed:
<?php
echo $form->field( $model, 'date_range', [
'options' => [ 'class'=>'form-group', 'autocomplete' => 'off' ]
] )->widget( DateRangePicker::classname(), [
'pluginOptions' => [
'ranges' => [
Yii::t('kvdrp', "Today") => ["moment().startOf('day')", "moment()"],
Yii::t('kvdrp', "Yesterday") => ["moment().startOf('day').subtract(1,'days')", "moment().endOf('day').subtract(1,'days')"],
Yii::t('kvdrp', "Next {n} Days", ['n' => 7]) => ["moment()", "moment().startOf('day').add(6, 'days')"],
Yii::t('kvdrp', "Last {n} Days", ['n' => 30]) => ["moment().startOf('day').subtract(29, 'days')", "moment()"],
Yii::t('kvdrp', "This Month") => ["moment().startOf('month')", "moment().endOf('month')"],
Yii::t('kvdrp', "Last Month") => ["moment().subtract(1, 'month').startOf('month')", "moment().subtract(1, 'month').endOf('month')"],
],
'alwaysShowCalendars' => true,
]
] );
?>
I tried adding initRangeExpr=true and presetDropdown=true without success.
Is there something I need to know or a bug?
Thanks a lot.
Hello, to make this extension easy to use, please provide the ability to set 2 attributes. Currently, as I understand reading the documentation, you can only set one attribute from a model, and when you want to actually use the selected dates, you have to extract them for yourself using ugly string handling.
It would be way better if you could set 2 attributes, just as you can do with your other extension yii2-field-range:
echo FieldRange::widget([
'form' => $form,
'model' => $model,
'label' => 'Enter date range',
'attribute1' => 'begin_date',
'attribute2' => 'end_date',
'type' => FieldRange::INPUT_DATE,
]);
Would be great to drop embed daterangepicker.js and moment.js in favour of composer dependencies. I am curretly stuck with some features wich are present in current daterangepicker v2 while plugin in shipped with outdated v1.
Hi,
i am getting the following error
Setting unknown property: <ModelNameHere>::startAttribute
with startAttribute and endAttribute configured like this
'startAttribute' => 'fiscalYearBegin',
'endAttribute' => 'fiscalYearEnd',
I traced the error to lines 484 of the DateRangePicker.php:
protected function initRangeValue($type = '', $value = '')
{
$attr = $type . 'Attribute';
if (!$this->$attr || empty($value)) {
return;
}
if ($this->hasModel()) {
$this->model->$attr = $value;
} else {
$opts = $type . 'InputOptions';
$options = $this->$opts;
$options['value'] = $value;
$this->$opts = $options;
}
}
So. As far as i understand it $attr is either "startAttribute" or "endAttribute". Both are public properties within the DateRangePicker. But in line 491
$this->model->$attr = $value;
the model is expected to have properties named exactly like that, ignoring the configuration and content of the widgets properties.
My guess is it should read:
$this->model->{$this->$attr} = $value;
... at least that works for me.
Cheers Kai
The following deployment populates the form element with 'Y-m-d' as expected
<?= $form->field($model, 'date_published', [
//'addon'=>['prepend'=>['content'=>'<i class="glyphicon glyphicon-calendar"></i>']],
'options'=>['class'=>'form-group field-page-date_published']
])->widget(DateRangePicker::classname(), [
// 'useWithAddon'=>true,
'convertFormat'=>true,
'pluginOptions'=>[
'timePicker'=>false,
'format'=>'Y-m-d',
'singleDatePicker'=>true,
'showDropdowns'=>true
] ]);
?>
...but if one uncomments the two lines to use the addon property, the form element is populated with 'Y-m-d - Y-m-d'. I realise that this is a DateRange picker, not a Date picker, but this still seems to me to look like a bug.
return [
'Today'=>'Сегодня',
'Yesterday'=>'Вчера',
'Last {n} Days'=>'Последние {n} дней',
'This Month'=>'Этот месяц',
'Last Month'=>'Прошлый месяц',
// Demo Data
'Select Date Range'=>'Выберите диапазон дат'
];
Major enhancement to translations. With this enhancement, widget will directly use moment.js locale files and all other translations will be configurable via kvdrp.php
which is the yii\i18n
messages configuration file.
Hello,
I trie used this daterange on filter with ModelSearch, but when i set PJAX true and clicking on the date field does not open the menu.
How to reproduce:
use kartik\grid\GridView;
use kartik\daterange\DateRangePicker;
...
[
'label' => Yii::t('app', "Confirmation Date"),
'attribute' => 'confirmation_date',
'value' => 'confirmation_date',
'format' => 'date',
'filter' => DateRangePicker::widget([
'model' => $searchModel,
'language' => 'es',
'attribute' => 'confirmation_date',
'convertFormat' => true,
'presetDropdown' => true,
'pluginOptions' => [
'locale' => [
'format' => 'Y-m-d',
],
],
]),
],
...
'pjax'=>true,
Version
kartik-v/yii2-date-range (dev-master 70febdb)
Checking out 70febdb
First , thanks for you good widget!
I found a bug on selecting "Today", http://demos.krajee.com/date-range, demo 3
, this bug is occurred on other demos if the initial value is not set.
sorry for my english. hope you understand.
Supported locales should be checked before setting locale option DateRangePicker.php#L213, because \kartik\widgets\InputWidget sets language automatically.
In my case dpr_locale_lt is undefined:
var daterangepicker_b5521ca8 = {"timePicker":false,"format":"YYYY-MM-DD","locale":dpr_locale_lt};
Hi
I use this nice widget twice on my view, but only once render on(.apply.daterangepicker javascript code. Hm.. what's wrong?
<?=DateRangePicker::widget([
'options'=>['id'=>'one'],
'name'=>'studentrange',
'convertFormat'=>true,
'pluginOptions'=>[
'id'=>'one',
'locale'=>['format'=>'Y/m/d'],
'separator'=>'-',
],
'pluginEvents'=>[
"apply.daterangepicker"=>"function(){ $('#filter').submit(); }",
]
]);?>
<?=DateRangePicker::widget([
'options'=>['id'=>'two'],
'name'=>'teacherrange',
'convertFormat'=>true,
'pluginOptions'=>[
'id'=>'two',
'locale'=>['format'=>'Y/m/d'],
'separator'=>'-',
],
'pluginEvents'=>[
"apply.daterangepicker"=>"function(){ $('#filter').submit(); }",
]
]);?>
jQuery(document).ready(function () {
if (jQuery('#w1').data('daterangepicker')) { jQuery('#w1').daterangepicker('destroy'); }
jQuery("#w1").daterangepicker(daterangepicker_5675aeba, function(start,end,label){var val=start.format('YYYY/MM/DD') + ' - ' + end.format('YYYY/MM/DD');jQuery("#w1").val(val);jQuery("#w1").trigger('change');});
jQuery("#w1").on('apply.daterangepicker', function(){ $('#filter').submit(); });
if (jQuery('#w2').data('daterangepicker')) { jQuery('#w2').daterangepicker('destroy'); }
jQuery("#w2").daterangepicker(daterangepicker_5ca83dc4, function(start,end,label){var val=start.format('YYYY-MM-DD') + ' - ' + end.format('YYYY-MM-DD');jQuery("#w2").val(val);jQuery("#w2").trigger('change');});
jQuery(document).pjax("#w0 a", "#w0", {"push":true,"replace":false,"timeout":1000,"scrollTo":false});
jQuery(document).on('submit', "#w0 form[data-pjax]", function (event) {jQuery.pjax.submit(event, '#w0', {"push":true,"replace":false,"timeout":1000,"scrollTo":false});});
$(function () {
$("[data-toggle='tooltip']").tooltip();
});;
$(function () {
$("[data-toggle='popover']").popover();
});
});
``
Correct the input rendering sequence so that the plugin data attributes are correctly registered.
I have an Invoice
model (with its InvoiceSearch
one extending it) having a delivery_date
field. I'm trying to use the DateRangePicker
widget to filter my yii\grid\GridView
.
DateRangePicker
configuration is:
$daterange = [
'model' => $invoiceSearch,
'attribute' => 'delivery_date',
'convertFormat' => false,
'pluginOptions' => [
'format' => 'YYYY-MM-DD',
],
];
so I use it in my column definition:
[...]
[
'attribute' => 'delivery_date',
'filter' => DateRangePicker::widget($daterange),
],
[...]
Widget works only the first time (i.e. calendar appears and after date selection the pjax request starts), but after the response replaces the grid view with the filtered one, date range picker is no more shown. Inspecting the pjax response, there is no new daterangepicker_<hash>
inside the html, while the input field has a new config data reference instead.
P.S.: if I replace config with this:
$daterange = [
'model' => $invoiceSearch,
'attribute' => 'delivery_date',
'convertFormat' => true,
'pluginOptions' => [
'format' => 'php:Y-m-d',
],
];
widget dates are not correctly parsed and appear like this: p12p:2015-08-18
instead of 2015-08-18
(always disappearing after the first request as before).
Do I miss something?
As seen here
I thinks it's not really necessary to add that class. Even less to hardcode it.
After updating to v1.6.4 my grid view is refreshing infinitely. I use daterangepicker as a filter for datetime column. Default filter value is empty, but after page load some value is inserted into filter input and grid form is submitted.
I use the DateRangerPick like this as a column :
[ 'attribute' => 'time', 'format' => ['date','php:Y-m-d'], //'class' => 'kartik\daterange\DateRangePiker' 'filterType' => GridView::FILTER_DATE_RANGE, 'filterWidgetOptions' => [ 'presetDropdown' => true, 'pluginOptions' => [ 'locale' => [ 'separator' => ' to ', 'format' => 'YYYY-MM-DD', ], ], ], ],
with old version, it work good, but for today have little problem.
when i upgrade for new version(v1.6.7).
I found the page drop into loop like:
get this request: http://127.0.0.1:8080/index.php?DeliverySearch%5Btime%5D=03%2F15%2F2016+-+03%2F15%2F2016&DeliverySearch%5Bcustomer_id%5D=&DeliverySearch%5BdetailCount%5D=&DeliverySearch%5Bmoney%5D=&DeliverySearch%5Bprofit%5D=&r=delivery%2Findex
The Web Console show this error:
VM124 index.php?DeliverySearch[time]=03%2F15%2F2016+-+03%2F15%2F2016&DeliverySearch[customer_id]=&D…:30 Uncaught TypeError: moment.weekdaysStart is not a function
The Source locate in this:
var kvGridExp_df43f813={"gridOpts":kvGridExp_16f6c083,"genOpts":kvGridExp_383dfdd3,"alertMsg":"将会导出JSON文件以供下载","config":{"colHeads":[],"slugColHeads":false,"jsonReplacer":function(k,v){return typeof(v)==='string'?$.trim(v):v},"indentSpace":4}}
So. what i could do for it? Downgrade?Thanks You for your patience!
Please close it, I found the resolve in the pull request. the weekdaysStart is wrong by weekdaysShort
On loading plugin the yii.js data-method listeners no longer work.
in DateRangerPickerAsset, on setting up js/daterangepicker asset, the yii.js action fails
public function init()
{
$this->setSourcePath(__DIR__ . '/assets');
$this->setupAssets('css', ['css/daterangepicker', 'css/daterangepicker-kv']);
$this->setupAssets('js', ['js/daterangepicker']);
parent::init();
}
Hey,
Your date-range have any option for the user clear the field ?
This is my config:
$form->field($task_event, 'search_date_range', [
'options'=>['class'=>'drp-container form-group']
])->widget(DateRangePicker::classname(), [
'useWithAddon'=>true,
'hideInput'=>true,
'language' => 'pt-BR'
]);
I have the DateRangePicker in my vendors folder and I have the use statement in my code and I am getting this error ...
exception 'yii\base\ErrorException' with message 'Class 'kartik\daterange\DateRangePicker' not found'
Any ideas why?
Complements enhancements in kartik-v/yii2-krajee-base#52 and kartik-v/yii2-krajee-base#53.
Value must be initialized correctly irrespective of the hideInput
property.
after init DateRangePicker Exception "An asset bundle that depends on 'yii\web\JqueryAsset' has a higher javascript file position configured than 'yii\web\JqueryAsset'."
helped deleting a row jsOptions
class LanguageAsset extends AssetBundle
{
// public $jsOptions = ['position' => \yii\web\View::POS_HEAD];
/**
* @inheritdoc
*/
public function init()
{
$this->depends = array_merge($this->depends, ['\kartik\daterange\MomentAsset']);
$this->setSourcePath(__DIR__ . '/assets');
parent::init();
}
}
Is there is away to make the user choose month and year only ? so it will be date interval based on months?
I'm trying to get the minDate and maxDate pluginOptions to work to limit the times the user is able to select. I would like the user to be able to select and time between now and 14 days in the future. Here is my code:
field($model, 'daterange', [ 'addon'=>['prepend'=>['content'=>'']], 'options'=>['class'=>'drp-container form-group'] ])->widget(DateRangePicker::classname(), [ 'useWithAddon'=>true, 'convertFormat' => true, 'pluginOptions' => [ 'timePicker' => true, 'timePickerIncrement' => 15, 'timePicker12Hour' => false, 'separator' => ' to ', 'minDate' => 'moment()', 'maxDate' => "moment().startOf('day').add(14,'days')", 'format' => 'Y-m-d h:i A'] ]); ?>Without the 'minDate' and 'maxDate' options, everything works, with them on, I cannot select any days and can only go back into the past.
The datepicker will not display a left arrow to select an end date earlier than the current date.
Deployed like this:
$datepicker = DateRangePicker::widget([
'name'=>'DownloadHistorySearch[download_datetime]',
'convertFormat'=>true,
'pluginOptions'=>[
'timePicker'=>false,
'format'=>'d-m-Y',
'opens'=>'left'
]
]);
My code is:
<?= $form->field($dateFilter, 'range', [
'options' => [
'style' => 'width: 200px',
]
])->widget(DateRangePicker::className(), [
'model' => $dateFilter,
'attribute' => 'range',
'presetDropdown' => false,
'initRangeExpr' => true,
'pluginOptions' => [
'format' => 'YYYY-MM-DD',
],
'pluginEvents' => [
"apply.daterangepicker" => "function() { $('#timeline-filterModel-form').submit(); }",
],
]) ?>
and I see the next daterangepicker:
(year as 000n)
In the 1.3.20 and 1.3.21 release of bootstrap-daterangepicker
there is a new functionality called drop
(and later drops
) to show the calendar above the input. I see that yii2-date-range it is outdated (version 1.3.17) so this functionality it is not working.
kartik\daterange\LanguageAsset does not get baseUrl, so when its loaded to the browser it appears like <script src="/js/locales/pt-BR.js"></script>
I'm getting this error and because of that the date range is not working.
TypeError: jQuery(...).daterangepicker is not a function
http://demos.krajee.com/date-range
The trouble is visible on your example. There is an empty daterange field configured with dropdown format. If you click it and choose "Today" nothing happens. You need to choose something else first to choose "today" or have not empty but rather today as a default value.
It seems the problem exists because the plugin does not support emptiness though your widget still tries to support it. I think internally the plugin is already at "Today" and that's why you can't make it "Today" again. Not supporting emptiness is sad because that way you can't use the widget for filtering the grid.
'attribute' => 'fecha_vencimiento',
'hAlign' => 'center',
'vAlign' => 'middle',
'filterType' => GridView::FILTER_DATE_RANGE,
'filterWidgetOptions' => [
'language'=>'es',
...]
Uncaught SyntaxError: Unexpected reserved word in
import moment from '../moment';
I used in my composer.json:
"bower-asset/moment": "2.9.0"
You use too. In result I have two folder with moment lib. Can you move your moment to composer assets?
There is a bug in your version of daterangepicker.js: there are two 31 days in december 2013
http://gyazo.com/11e415d7557040ac0b9c6e43d67236cd
This is fixed in current version.
Use updated features from Krajee Base release v1.3.0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.