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

Commit e01ea89

Browse files
committed
Fixed: in case the date-format string included other specifiers than day, month or year, the date wasn’t parsed correctly in other languages when opening the calendar. For instance the format EEE dd.MM.yyyy wasn’t parsed correctly.
1 parent 5d7573e commit e01ea89

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)