Skip to content

Commit d54cd25

Browse files
author
aisen60
committed
/src/utils/index.js parseTime 添加IE浏览器(版本10以下,包括版本10)兼容。
1 parent c2a5a15 commit d54cd25

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/utils/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export function parseTime(time, cFormat) {
1919
} else {
2020
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
2121
time = parseInt(time)
22+
} else if (typeof time === 'string') {
23+
time = time.replace(new RegExp(/-/gm), '/');
2224
}
2325
if ((typeof time === 'number') && (time.toString().length === 10)) {
2426
time = time * 1000

0 commit comments

Comments
 (0)