Skip to content

Commit dca13b4

Browse files
committed
feat: suppress the date string format warning in Weixin DevTools
1 parent 5f5cc8f commit dca13b4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/utils/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ const inherits = function inherits(parent, protoProps, staticProps) {
9191
return child;
9292
};
9393

94-
const parseDate = iso8601 => new Date(Date.parse(iso8601));
94+
// Suppress the date string format warning in Weixin DevTools
95+
// Link: https://developers.weixin.qq.com/community/minihome/doc/00080c6f244718053550067736b401
96+
const parseDate =
97+
typeof wx === 'undefined'
98+
? iso8601 => new Date(iso8601)
99+
: iso8601 => new Date(Date.parse(iso8601));
95100

96101
const setValue = (target, key, value) => {
97102
// '.' is not allowed in Class keys, escaping is not in concern now.

0 commit comments

Comments
 (0)