Twix
npm install twix
Another range plugin is Isaac Cambron's library Twix
. It has manyrange-related features and excels at formatting ranges readably. For example,
var t = moment("1/25/1982 9:30 AM").twix("1/25/1982 1:30 PM");
t.isCurrent(); // false
t.count('minutes'); // 241
t.format(); // 'Jan 25, 1982, 9:30 AM - 1:30 PM'
t.simpleFormat("h:m"); // '9:30 - 1:30'
Full documentation of all the options and features is here.
It's available on npm like so:
npm install twix
Or just grab the JS file from here.
当前内容版权归 momentjs.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 momentjs.com .