Skip to content

Commit 509f287

Browse files
committed
perf: parseInt for string-leading int extraction
1 parent 0e05f95 commit 509f287

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/dates.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ exports.dateTime2ms = function(s, calendar) {
178178
var calInstance = Registry.getComponentMethod('calendars', 'getCal')(calendar);
179179
if(isChinese) {
180180
var isIntercalary = m.charAt(m.length - 1) === 'i';
181-
m = Number(isIntercalary ? m.substr(0, m.length - 1) : m);
181+
m = parseInt(m, 10);
182182
cDate = calInstance.newDate(y, calInstance.toMonthIndex(y, m, isIntercalary), d);
183183
}
184184
else {

0 commit comments

Comments
 (0)