Skip to content
This repository has been archived by the owner on Feb 14, 2019. It is now read-only.

Set Date to null if character entered is non alpha numeric instead of 31 December 1899 #434

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions js/bootstrap-datetimepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,9 @@
return {separators: separators, parts: parts};
},
parseDate: function (date, format, language, type, timezone) {
if (date && !date.toString().match(this.nonpunctuation)) {
return null;
}
if (date instanceof Date) {
var dateUTC = new Date(date.valueOf() - date.getTimezoneOffset() * 60000);
dateUTC.setMilliseconds(0);
Expand Down