Skip to content

Commit

Permalink
Fix #50: Enhancement for single date picker plugin functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Oct 19, 2015
1 parent d750edd commit 37c1201
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Version 1.6.4
- (enh #43): Add Slovak translations.
- (bug #45): Correct MomentAsset dependency.
- (enh #46): Better defaulting of `form-control` CSS class.
- (enh #50): Enhancement for single date picker plugin functionality.
- (enh #51): Update to latest release of bootstrap-datarangepicker plugin.

Version 1.6.3
Expand Down
6 changes: 5 additions & 1 deletion DateRangePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,13 @@ function(start, end) {
JS;
} elseif ($this->useWithAddon) {
$id = "{$input}.closest('.input-group')";
$val = "start.format('{$this->_format}') + '{$this->_separator}' + end.format('{$this->_format}')";
if (ArrayHelper::getValue($this->pluginOptions, 'singleDatePicker', false)) {
$val = "start.format('{$this->_format}')";
}
$this->callback = <<< JS
function(start, end) {
var val = start.format('{$this->_format}') + '{$this->_separator}' + end.format('{$this->_format}');
var val = {$val};
{$input}.val(val);
{$input}.trigger('change');
}
Expand Down

0 comments on commit 37c1201

Please sign in to comment.