Minimal Weekday Abbreviations1.7.0+

  1. // From 2.12.0 onward
  2. moment.updateLocale('en', {
  3. weekdaysMin : String[]
  4. });
  5. moment.updateLocale('en', {
  6. weekdaysMin : Function
  7. });
  8. // From 2.8.1 to 2.11.2
  9. moment.locale('en', {
  10. weekdaysMin : String[]
  11. });
  12. moment.locale('en', {
  13. weekdaysMin : Function
  14. });
  15. // Deprecated in 2.8.1
  16. moment.lang('en', {
  17. weekdaysMin : String[]
  18. });
  19. moment.lang('en', {
  20. weekdaysMin : Function
  21. });

Locale#weekdaysMin should be an array of two letter weekday abbreviations. The purpose of these is for things like calendar pickers, thus they should be as small as possible.

  1. moment.updateLocale('en', {
  2. weekdaysMin : ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
  3. });

Locale#weekdaysMin can be a callback function as well.

  1. moment.updateLocale('en', {
  2. weekdaysMin : function (momentToFormat, format) {
  3. return weekdaysMin[momentToFormat.day()];
  4. }
  5. });