Skip to content

Commit

Permalink
Error fix
Browse files Browse the repository at this point in the history
- fixed date parsing error when the date value is empty
  • Loading branch information
dmuy committed May 3, 2018
1 parent 3cdd91b commit b64b3e0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions duDatepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,8 @@ if (typeof jQuery === 'undefined') { throw new Error('DUDatePicker: This plugin
firstM = format.indexOf('m'), firstD = format.indexOf('d'), firstY = format.indexOf('y'),
month = '', day = '', year = '';

if (date === '') return { m: null, d: null, y: null, date: new Date('') };

// Get month on given date string using the format (default or specified)
if(isFullMonth) {
var monthIdx = -1;
Expand Down

0 comments on commit b64b3e0

Please sign in to comment.