在哪里可以找到 Date.prototype.toLocaleDateString 格式的官方列表?它没有从该 MDN 页面链接,并且“这个措辞混乱的问题”的可接受答案列出了一组不同的格式。 CLDR 数据库 很难使用。 我想要的是一张简单的地图,如下图所示:
const date = new Date();
for (const locale of ['en-US', 'en-GB', 'en-CA'])
console.log(locale, '=>', date.toLocaleDateString(locale, { }));
传递
{ month: 'short' }
而不是空选项对象可获得奖励积分。