From f4c88306222e1766d462a5aaa503937e679c2636 Mon Sep 17 00:00:00 2001 From: joker Date: Wed, 12 Apr 2017 21:29:53 +0300 Subject: [PATCH] define month array --- src/dateparser/dateparser.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dateparser/dateparser.js b/src/dateparser/dateparser.js index d770dff31b..45ac31c474 100644 --- a/src/dateparser/dateparser.js +++ b/src/dateparser/dateparser.js @@ -232,10 +232,11 @@ angular.module('ui.bootstrap.dateparser', []) ]; if (angular.version.major >= 1 && angular.version.minor > 4) { + var monthArray = $locale.DATETIME_FORMATS.STANDALONEMONTH || $locale.DATETIME_FORMATS.MONTH; formatCodeToRegex.push({ key: 'LLLL', - regex: $locale.DATETIME_FORMATS.STANDALONEMONTH.join('|'), - apply: function(value) { this.month = $locale.DATETIME_FORMATS.STANDALONEMONTH.indexOf(value); }, + regex: monthArray.join('|'), + apply: function(value) { this.month = monthArray.indexOf(value); }, formatter: function(date) { return dateFilter(date, 'LLLL'); } }); }