提交 0e75dcc4 编写于 作者: P Pan

fix[parseTime]: fix getDay() bug

上级 189e645b
......@@ -25,7 +25,8 @@ export function parseTime(time, cFormat) {
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
if (key === 'a') { return ['', '', '', '', '', '', ''][value - 1] }
// Note: getDay() returns 0 on Sunday
if (key === 'a') { return ['', '', '', '', '', '', ''][value ] }
if (result.length > 0 && value < 10) {
value = '0' + value
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册