且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从Moment.js中删除日期?

更新时间:2023-11-05 12:17:40

很抱歉这么晚才进入,但如果你想删除时间片刻()的一部分而不是格式化它,然后代码是:

Sorry to jump in so late, but if you want to remove the time portion of a moment() rather than formatting it, then the code is:

.startOf('day')

参考: http://momentjs.com/docs/#/manipulating/start-of/