Short Date Formatter

If you want to format times in a short way, you can use the moment-shortformat plugin by @researchgate.

It is based on and similar to the moment.twitter plugin but has a different output.

  1. moment().subtract(5, 'hours').short();
  2. // 5h ago
  3. moment().add(5, 'hours').short();
  4. // in 5h

You can also disable the use of the relative time templates

  1. moment().subtract(1, 'hour').short(false);
  2. // 1h

If the date is too far in the future or the past it will display like that

  1. moment().subtract(500, 'days').short();
  2. // 5 Mar, 1970