Ank*_*nks 0 jquery json momentjs
我有一个日期格式的 moment 对象,但 _a(array) 实际上以所有整数返回格式,见下文。
_a: Array[7]
0: 2014
1: 2
2: 22
3: 0
4: 0
5: 0
6: 0
length: 7
Run Code Online (Sandbox Code Playgroud)
我的问题是有可能将月份实际设置为月份的名称字符串吗?
编辑:这是我拨打的那一刻,这是数组中返回的内容
moment(datetoformat, "ddd MMM DD");
Run Code Online (Sandbox Code Playgroud)
我知道它晚了,但我最近遇到了同样的问题 这是简单直接的使用toArray()功能
moment().toArray()
Run Code Online (Sandbox Code Playgroud)
它将返回一个这样的数组:
[2014, 6, 20, 18, 21, 55, 285]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2761 次 |
| 最近记录: |