【发布时间】:2017-12-03 05:29:16
【问题描述】:
我有这样的约会
2017-06-23 我想要的输出是
2017 年 6 月 23 日星期五
v.npi.appointment_dates[j] = date.toLocaleString('en-US', {year: 'numeric', month: 'long', day: 'numeric' });
但是由于 day: 'numeric' 我错过了日期名称。谁能帮帮我?
【问题讨论】:
-
您是在问如何使用 JS 格式化日期?
-
看看 Date 对象并自己构建它...
-
@evolutionxbox...是的
-
不是因为
day: 'numeric',而是因为你省略了weekday: 'long'。
标签: javascript date time meanjs