Skip to content

Commit

Permalink
Make sure hidden date field stays in sync when user manually deletes …
Browse files Browse the repository at this point in the history
…date
  • Loading branch information
flack committed Jan 11, 2017
1 parent 99d9514 commit 726f7f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/midcom/helper/datamanager2/widget/jsdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ function()
prevText: '',
nextText: '',
showOn: '{$this->showOn}'
}).on('change', function() {
if ($(this).val() == '') {
$("#{$this->_namespace}{$this->name}_date").val('');
}
});
if ($("#{$this->_namespace}{$this->name}_date").val()) {
$("#{$this->_namespace}{$this->name}_input").datepicker('setDate', new Date($("#{$this->_namespace}{$this->name}_date").val()));
Expand Down

0 comments on commit 726f7f1

Please sign in to comment.