mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
startDate priority override
This commit is contained in:
parent
e94b766df3
commit
db71119edb
@ -1229,16 +1229,23 @@
|
|||||||
datetimepicker.setOptions(options);
|
datetimepicker.setOptions(options);
|
||||||
|
|
||||||
function getCurrentValue(){
|
function getCurrentValue(){
|
||||||
var ct = options.value?options.value:(input&&input.val&&input.val())?input.val():'';
|
|
||||||
|
|
||||||
if( ct && _xdsoft_datetime.isValidDate(ct = Date.parseDate(ct, options.format)) ) {
|
var ct = false;
|
||||||
|
|
||||||
|
if (options.startDate instanceof Date && !isNaN(options.startDate.valueOf())) {
|
||||||
|
ct = options.startDate;
|
||||||
|
} else if (!ct && options.startDate!==false) {
|
||||||
|
ct = _xdsoft_datetime.strToDateTime(options.startDate);
|
||||||
|
} else if (!ct) {
|
||||||
|
ct = options.value?options.value:(input&&input.val&&input.val())?input.val():'';
|
||||||
|
ct = Date.parseDate(ct, options.format);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ct && _xdsoft_datetime.isValidDate(ct) ) {
|
||||||
datetimepicker.data('changed',true);
|
datetimepicker.data('changed',true);
|
||||||
}else
|
} else {
|
||||||
ct = '';
|
ct = '';
|
||||||
|
}
|
||||||
if( !ct && options.startDate!==false ){
|
|
||||||
ct = _xdsoft_datetime.strToDateTime(options.startDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ct?ct:0;
|
return ct?ct:0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user