Skip to content

Commit

Permalink
feat: suppress the date string format warning in Weixin DevTools
Browse files Browse the repository at this point in the history
  • Loading branch information
sdjdd committed Sep 25, 2023
1 parent 5f5cc8f commit dca13b4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ const inherits = function inherits(parent, protoProps, staticProps) {
return child;
};

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

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

0 comments on commit dca13b4

Please sign in to comment.