MomentJS - Calendar


Advertisements

This helps in customizing calendar object for a locale set.

Syntax

moment.updateLocale('en', {
   calendar : Object
});

Example

var localeData = moment.locale('de', {
   calendar: {
      sameDay: "[heute um] LT",
      sameElse: "L",
      nextDay: '[morgen um] LT',
      nextWeek: 'dddd [um] LT',
      lastDay: '[gestern um] LT',
      lastWeek: '[letzten] dddd'
   },
});
var m = moment().subtract(1, 'days').calendar();

Output

Calender
momentjs_customization.htm
Advertisements