introduced DateTime Type

This is similar to Date but also accepts a time. Only uses a Date
picker, no time picker as we currently have none available.
This commit is contained in:
Andreas Gohr
2016-07-26 17:09:02 +02:00
parent 01f8b8453d
commit 4a2883e0ee
4 changed files with 77 additions and 0 deletions

View File

@ -83,6 +83,23 @@ jQuery(function () {
dateFormat: 'yy-mm-dd'
});
/**
* Attach datepicker to datetype types, keeps time part
*/
jQuery('input.struct_datetime').datepicker({
dateFormat: 'yy-mm-dd',
onSelect: function(date, inst){
var $input = jQuery(this);
var both = inst.lastVal.split(' ', 2);
if(both.length == 2) {
date += ' ' + both[1];
} else{
date += ' 00:00:00';
}
$input.val(date);
}
});
/**
* Attach image dialog to image types
*/