File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -496,10 +496,10 @@ class CUI.DateTimeRangeGrammar
496496 value = s .split (" ." )[0 ]
497497 else if CUI .DateTimeRangeGrammar .REGEXP_CENTURY .test (s)
498498 type = CUI .DateTimeRangeGrammar .TYPE_CENTURY
499- value = s .split (" th " )[0 ]
500- else if value in CUI .DateTimeRangeGrammar .MONTHS [ locale]
499+ value = s .split (/ th / i )[0 ]
500+ else if ( monthIndex = CUI .DateTimeRangeGrammar .__findMonthIndex (s, locale)) >= 0
501501 type = CUI .DateTimeRangeGrammar .TYPE_MONTH
502- value = CUI . DateTimeRangeGrammar . MONTHS [locale]. indexOf (value)
502+ value = monthIndex
503503 else
504504 type = s # The type for everything else is the value.
505505
@@ -728,4 +728,14 @@ class CUI.DateTimeRangeGrammar
728728 @ __toBC: (inputString ) ->
729729 if inputString .match (CUI .DateTimeRangeGrammar .REGEXP_YEAR )
730730 inputString = parseInt (inputString) - 1
731- return " -#{ inputString} "
731+ return " -#{ inputString} "
732+
733+ @ __findMonthIndex: (value , locale ) ->
734+ lowerValue = value .toLowerCase ()
735+ months = CUI .DateTimeRangeGrammar .MONTHS [locale]
736+ if not months
737+ return - 1
738+ for month, index in months
739+ if month .toLowerCase () == lowerValue
740+ return index
741+ return - 1
You can’t perform that action at this time.
0 commit comments