Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Commit 793972c

Browse files
authored
Merge pull request #270 from adrianhara/master
Fixed: date parse error when opening calendar with "special" date format string
2 parents 5d7573e + e01ea89 commit 793972c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/js/angular-datepicker.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -313,15 +313,15 @@
313313

314314
switch (true) {
315315
case el.indexOf('d') !== -1: {
316-
d = dateSplit[index];
316+
d = dateSplit[index - (formatDate.length - dateSplit.length)];
317317
break;
318318
}
319319
case el.indexOf('M') !== -1: {
320-
m = dateSplit[index];
320+
m = dateSplit[index - (formatDate.length - dateSplit.length)];
321321
break;
322322
}
323323
case el.indexOf('y') !== -1: {
324-
y = dateSplit[index];
324+
y = dateSplit[index - (formatDate.length - dateSplit.length)];
325325
break;
326326
}
327327
default: {

0 commit comments

Comments
 (0)