mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
Merge pull request #603 from ctantonello/master
Insert sensible defaults (1) for out.month and out.day if parsing with format string didn't set them
This commit is contained in:
commit
edefba5777
@ -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