【发布时间】:2021-09-29 07:26:48
【问题描述】:
使用momentjs,效果非常好——返回13m:
moment.duration(sg.time_played, 'seconds').format('d[d] h[h] m[m]')
还有 DayJS:
dayjs.duration(sg.time_played, 'seconds').format('d[d] h[h] m[m]')
它将返回以下字符串:undefinedd undefined 13m。
这两个函数的预期输出是 13m,并且不完全确定为什么 DayJS 插件不能像现在那样工作。
谢谢。
【问题讨论】:
-
moment.duration()没有.format()方法,它怎么可能工作?
标签: javascript momentjs dayjs