date - 为什么 Intl.DateTimeFormat 根据年份在 Safari 中返回不同的月份?
问题描述
new Intl.DateTimeFormat('en-US', {'month': 'short'}).format(new Date(2007, 3));
> "Apr"
new Intl.DateTimeFormat('en-US', {'month': 'short'}).format(new Date(2006, 3));
> "Mar"
new Intl.DateTimeFormat('en-US', {'month': 'short'}).format(new Date(2007, 10));
> "Nov"
new Intl.DateTimeFormat('en-US', {'month': 'short'}).format(new Date(2006, 10));
> "Oct"
苹果浏览器Version 11.1 (13605.1.33.1.4)
在 Chrome 中,它返回我所期望的(Apr、Apr、Nov、Nov)。
解决方案
推荐阅读
- javascript - 如何在不截断值的情况下使用 autoNumeric 填充 lat/lng 值?
- python - ModuleNotFoundError:没有名为“winreg”的模块
- c# - 如何在并行 ForEach 循环中从数组中选择一个随机元素?
- angular - 角primeng树文件夹上下箭头不起作用
- java - 点燃 cron 中的 ClassNotFoundException
- java - sh startAgent.sh 在 MacOS 中不适用于 jmeter perfmon 插件
- c++ - 如何将 libjingle_peerconnection_so.so 链接到项目并从中调用类?
- python - 如何让 Python 尝试从本地文件夹加载模块?
- javascript - 如何在 Visual Studio 中定义 HTML 文件扩展名?
- android - ConcatAdapter 内部的 Paging3 Library 的 PagingDataAdapter 加载所有页面而不滚动