Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adapt iOS date string format #678

Merged
merged 1 commit into from
Sep 25, 2023
Merged

feat: adapt iOS date string format #678

merged 1 commit into from
Sep 25, 2023

Conversation

sdjdd
Copy link
Contributor

@sdjdd sdjdd commented Sep 21, 2023

某些 iOS 设备可能不支持使用 yyyy-MM-ddTHH:mm:ssZ 格式的字符串创建 Date。

微信开发者工具在新版中加入了警告,每次用上述格式调用 Date 构造函数时就会在控制台打印一条日志,影响开发时的体验。

由于不方便在 adapters 中修改 AV 上面的方法,索性直接改写 AV._parseDate,也同时支持了 react-native 等平台。

$ node benchmark.js '2020-01-02T03:04:05.678Z' 10000000
new Date(dateString): 4.375s
new Date(Date.parse(dateString)): 4.687s

@sdjdd sdjdd requested a review from leeyeh September 21, 2023 04:13
@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (676758d) 61.25% compared to head (0bebd4b) 61.25%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #678   +/-   ##
=======================================
  Coverage   61.25%   61.25%           
=======================================
  Files          40       40           
  Lines        3479     3479           
=======================================
  Hits         2131     2131           
  Misses       1348     1348           
Files Changed Coverage Δ
src/utils/index.js 98.52% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sdjdd sdjdd merged commit 5f5cc8f into master Sep 25, 2023
3 checks passed
@sdjdd sdjdd deleted the feat/ios-date-format branch September 25, 2023 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants