UNPKG

dayjs

Version:

2KB immutable date time library alternative to Moment.js with the same modern API

2 lines (1 loc) 883 B
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs_plugin_localeData=e()}(this,function(){"use strict";return function(t,e,n){var r=function(t,e,n,r){var o=t.$locale();return o[e]?o[e]:o[n].map(function(t){return t.substr(0,r)})};e.prototype.localeData=function(){return function(){var t=this;return{months:function(e){return e?e.format("MMMM"):r(t,"months")},monthsShort:function(e){return e?e.format("MMM"):r(t,"monthsShort","months",3)},firstDayOfWeek:function(){return t.$locale().weekStart||0},weekdaysMin:function(e){return e?e.format("dd"):r(t,"weekdaysMin","weekdays",2)},weekdaysShort:function(e){return e?e.format("ddd"):r(t,"weekdaysShort","weekdays",3)}}}.bind(this)()},n.localeData=function(){var t=n.Ls[n.locale()];return{firstDayOfWeek:function(){return t.weekStart||0}}}}});