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

Commit

Permalink
Return null if characters are bad
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpatters0n committed Dec 9, 2016
1 parent 0175948 commit 591df69
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/bootstrap-datetimepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,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

0 comments on commit 591df69

Please sign in to comment.