Parse Date Format
npm install moment-parseformat
This plugin extracts the format of a date/time string.
var format = moment.parseFormat('Thursday, February 6th, 2014 9:20pm');
// dddd, MMMM Do, YYYY h:mma
moment().format(format); // format
That allows to create smart date inputs that let your users set aDate/Time and lets you extract the user's preferred format for future usage.Find an example usage of it at minutes.io.
当前内容版权归 momentjs.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 momentjs.com .