Skip to content

Commit

Permalink
Merge pull request #12 from zms-publishing/timepicker
Browse files Browse the repository at this point in the history
Fixed timepicker in Firefox workaround
  • Loading branch information
drfho authored Jun 9, 2021
2 parents 4f85539 + 583dead commit 7025c11
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1125,10 +1125,17 @@ ZMI.prototype.initInputFields = function(container) {
var icon_picker = eval('icon_' + $(this).prop('class').split(' ').filter(function(v) {return v.endsWith('picker')}));
$(this).before('<div class="input-group-prepend"><span class="input-group-text"><i class="'+ icon_picker +'"></i></span></div>');
if (is_firefox) {
$(this).attr('type','date');
if ($(this).attr('type') == 'datetime-local') {
$(this).attr('type', 'date');
}
$(this).attr('value',$(this).attr('value').split('T')[0]);
$(this).dblclick(() => {
$(this).attr('type','datetime-local');
if ($(this).attr('type') == 'datetime-local') {
$(this).attr('type', 'date');
}
else if ($(this).attr('type') == 'date') {
$(this).attr('type', 'datetime-local');
}
$(this).attr('value',$(this).attr('data-initial-value'));
});
}
Expand Down

0 comments on commit 7025c11

Please sign in to comment.