Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Multidate not working with 'inline' #14

Open
boutsen opened this issue Jun 18, 2015 · 3 comments
Open

Multidate not working with 'inline' #14

boutsen opened this issue Jun 18, 2015 · 3 comments

Comments

@boutsen
Copy link

boutsen commented Jun 18, 2015

When using multidate and multidateSeparator in inline mode I notice only the last date selected is being updated in the input tag.

<?= DatePicker::widget([
                'inline' => true,
                'name' => 'test',
                'template' => '<div class="well well-sm" 
style="background-color: #fff; width:250px">{input}</div>',
                'clientOptions' => [
                    'format' => "yyyy-mm-dd",
                    'weekStart' => 1,
                    'startDate' => "today+1",
                    'daysOfWeekDisabled' => "0",
                    'multidate' => true,
                    'multidateSeparator' => ";",
                ]
            ]);?>

For example if I select 2 dates :
The input tag value only contains 1 date ( last one selected ).

capture

@tonydspaniard
Copy link
Member

I believe the internal jquery plugin doesn't work properly with multiple date selection 'inline'. What about DateRangePicker instead?

@utkarshshinde07
Copy link

I got same issue in kartik's bootstrap datepicker i solved issue by changing line from 439 to 441. its in under function registerAssets().
if ($this->type === self::TYPE_INLINE) {
$view->registerJs("{$el}.on('changeDate',function(e){{$input}.val({$el}.kvDatepicker('getFormattedDate'));});");
}

@mohdqasim98
Copy link

I believe the internal jquery plugin doesn't work properly with multiple date selection 'inline'. What about DateRangePicker instead?

That won't work, in case someone wants to select non-continuous dates

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants