Twix

  1. 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,

  1. var t = moment("1/25/1982 9:30 AM").twix("1/25/1982 1:30 PM");
  2. t.isCurrent(); // false
  3. t.count('minutes'); // 241
  4. t.format(); // 'Jan 25, 1982, 9:30 AM - 1:30 PM'
  5. 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:

  1. npm install twix

Or just grab the JS file from here.