-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
moment-immutable.min.js
1 lines (1 loc) · 1.36 KB
/
moment-immutable.min.js
1
"use strict";!function(e,t){"object"==typeof exports?module.exports=t(require("moment")):"function"==typeof define&&define.amd?define("moment-immutable",["moment"],t):e.moment=t(e.moment)}(this,function(n){if(!n)throw new Error("Can't find moment.js");function o(e,t,n){var o=e[t];"function"==typeof o&&(n=n||0,e[t]=function(){var e;return this._mutable||arguments.length<n||!this._isAMomentObject?o.apply(this,arguments):((e=this.clone())._mutable=!0,(e=o.apply(e,arguments))._mutable=!1,e)})}function a(t,n){Object.keys(n).forEach(function(e){o(t,e,n[e])})}function i(e,t,n){Array.isArray(t)?t.forEach(function(e){o(e,0)}):"object"==typeof t?a(t):o(t,n)}return a(n.fn,{add:0,endOf:0,lang:0,locale:1,set:0,startOf:0,subtract:0,year:1,weekYear:1,isoWeekYear:1,quarters:1,quarter:1,month:1,weeks:1,week:1,isoWeeks:1,isoWeek:1,date:1,days:1,day:1,weekday:1,isoWeekday:1,dayOfYear:1,hours:1,hour:1,minutes:1,minute:1,seconds:1,second:1,milliseconds:1,millisecond:1,utcOffset:1,utc:0,local:0,parseZone:0,dates:1,months:1,years:1,zone:1,tz:1,period:1}),a(n.duration.fn,{abs:0,add:0,subtract:0,locale:1,lang:1}),n.fn.mutable=function(e){return null==e?this._mutable:(this._mutable=!!e,this)},n.immutable={version:"1.0.9",addMomentMutable:function(e,t){return i(n.fn,e,t),n.immutable},addDurationMutable:function(e,t){return i(n.duration.fn,e,t),n.immutable}},n.momentProperties.push("_mutable"),n});