UNPKG

dayjs-ext

Version:

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

3 lines (2 loc) 518 B
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.dayjs_plugin_weekOfYear=t()}(this,function(){"use strict";var f="year";return function(e,t,d){t.prototype.week=function(){var e=this.endOf(f);if(6!==e.day()&&11===this.month()&&31-this.date()<=e.day())return 1;var t=d(this.$d).startOf(f),i=t.subtract(t.day(),"day").subtract(1,"millisecond"),n=this.diff(i,"week",!0);return Math.ceil(n)}}}); //# sourceMappingURL=weekOfYear.js.map