mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
Insert sensible defaults (1) for out.month and out.day if parsing with format string didn't set them
See issue #550
This commit is contained in:
parent
1525c13027
commit
286bcf5178
@ -217,7 +217,11 @@ var DateFormatter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (vDateFlag === true && out.year && out.month && out.day) {
|
||||
if (vDateFlag === true) {
|
||||
// Set month and day to 1 if they are null
|
||||
out.month = out.month || 1;
|
||||
out.day = out.day || 1;
|
||||
|
||||
out.date = new Date(out.year, out.month - 1, out.day, out.hour, out.min, out.sec, 0);
|
||||
} else {
|
||||
if (vTimeFlag !== true) {
|
||||
|
Loading…
Reference in New Issue
Block a user