mirror of
https://github.com/cosmocode/dokuwiki-plugin-struct.git
synced 2025-08-06 10:24:17 +00:00
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:
17
script.js
17
script.js
@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user