mat-date 1.9.12 → 1.9.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DateUtil.d.ts +2 -0
- package/dist/DateUtil.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/DateUtil.d.ts
CHANGED
|
@@ -94,6 +94,8 @@ export declare class MDateUtil {
|
|
|
94
94
|
addDay(value: number): this;
|
|
95
95
|
addHours(value: number): this;
|
|
96
96
|
addMins(value: number): this;
|
|
97
|
+
addSecs(value: number): this;
|
|
98
|
+
addMilliseconds(value: number): this;
|
|
97
99
|
startOfDay(): this;
|
|
98
100
|
cpyByStartOfDay(): MDateUtil;
|
|
99
101
|
endOfDay(): this;
|
package/dist/DateUtil.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x239e53={};a0_0x239e53['value']=!![],Object['defineProperty'](exports,'__esModule',a0_0x239e53),exports['MDateUtil']=void 0x0;const a0_0x1d23d0=require('@js-temporal/polyfill'),a0_0x558bea=(_0x2d655d,_0x32c2a2=0x2)=>_0x2d655d['toString']()['padStart'](_0x32c2a2,'0');function a0_0x2829f2(_0x2c6c55,_0x335373){try{return _0x2c6c55();}catch(_0x5a0ef5){if(_0x335373)return _0x335373;throw new Error('UNKNOWN');}}function a0_0xf07824(_0x256e4d,_0x56712e){try{if(_0x256e4d instanceof Date)return a0_0x1d23d0['Temporal']['Instant']['fromEpochMilliseconds'](_0x256e4d['getTime']())['toZonedDateTimeISO'](_0x56712e)['epochMilliseconds'];if(typeof _0x256e4d==='number')return _0x256e4d;if(typeof _0x256e4d==='string')return a0_0x1d23d0['Temporal']['Instant']['fromEpochMilliseconds'](new Date(_0x256e4d)['getTime']())['toZonedDateTimeISO'](_0x56712e)['epochMilliseconds'];if(_0x256e4d instanceof a0_0x51d49d)return _0x256e4d['toTime']();if(_0x256e4d['idkey']==='MDateUtil')return _0x256e4d['toTime']();return 0x0;}catch(_0x4b2b91){throw new Error('ERROR');}}function a0_0x582e5f(_0x4ad3d9){function _0x3abed2(_0x3276dd){const _0x1cd4b6={};return _0x1cd4b6['weekday']=_0x3276dd,a0_0x2829f2(()=>new Intl['DateTimeFormat'](_0x4ad3d9['localCode'],_0x1cd4b6)['format'](a0_0xf07824(_0x4ad3d9,_0x4ad3d9['zone'])),'');}function _0x329ce9(){return _0x3abed2('long');}function _0x5c4c01(){return _0x3abed2('short');}function _0xe6afc2(){return _0x3abed2('narrow');}const _0xefa61a={};return _0xefa61a['ln']=_0x329ce9,_0xefa61a['sh']=_0x5c4c01,_0xefa61a['nr']=_0xe6afc2,_0xefa61a;}function a0_0x392557(_0x20071f){let _0x4e30f8=undefined,_0x2eb77d=undefined,_0x3d5581=undefined,_0x119e31=undefined;try{const _0x4d61b5=(_0x20071f||'')['match'](/\w{2}:\w{2}(:\w{2})?\b/g)[0x0]['split'](':');_0x4e30f8=_0x4d61b5['length']>=0x1?Number(_0x4d61b5[0x0]):undefined,_0x2eb77d=_0x4d61b5['length']>=0x2?Number(_0x4d61b5[0x1]):undefined,_0x3d5581=_0x4d61b5['length']>=0x3?Number(_0x4d61b5[0x2]):undefined;}catch(_0x342a49){}try{let _0x46a64a=_0x20071f||'',_0x262e5c=/\.\d{3}/g,_0x3ac5ee=_0x46a64a['match'](_0x262e5c)[0x0]['split']('.')['filter'](_0x403a1a=>Boolean(_0x403a1a));_0x119e31=_0x3ac5ee['length']>=0x1?Number(_0x3ac5ee[0x0]):undefined;}catch(_0x36eeee){}const _0x232b53={};return _0x232b53['h']=_0x4e30f8,_0x232b53['m']=_0x2eb77d,_0x232b53['s']=_0x3d5581,_0x232b53['ms']=_0x119e31,_0x232b53;}let a0_0x5e6cee=Intl['NumberFormat']()['resolvedOptions']()['locale'],a0_0x141411=Intl['DateTimeFormat']()['resolvedOptions']()['timeZone'];class a0_0x51d49d{['val'];['_code']=Intl['NumberFormat']()['resolvedOptions']()['locale'];['_zone']=Intl['DateTimeFormat']()['resolvedOptions']()['timeZone'];['dyfrmt']=a0_0x582e5f(this);get['localCode'](){return this['_code'];}get['zone'](){return this['_zone'];}['with'](_0xaadf9d){this['val']=this['val']['with']({'year':_0xaadf9d['getFullYear'](),'month':_0xaadf9d['getMonth']()+0x1,'day':_0xaadf9d['getDate'](),'hour':_0xaadf9d['getHours'](),'minute':_0xaadf9d['getMinutes'](),'second':_0xaadf9d['getSeconds'](),'millisecond':_0xaadf9d['getMilliseconds']()});}['init'](){const _0x383eec=new Date();return this['val']=a0_0x1d23d0['Temporal']['Instant']['from'](_0x383eec['toISOString']())['toZonedDateTimeISO'](this['zone']),this['dyfrmt']=a0_0x582e5f(this),this;}['toString'](){return'---';}static['new'](){return new a0_0x51d49d()['setCode'](a0_0x5e6cee)['setZone'](a0_0x141411)['init']();}static['setCode'](_0x3c783b){return a0_0x5e6cee=_0x3c783b,this;}static['setZone'](_0x99ec61){return a0_0x141411=_0x99ec61,this;}static['seperator'](){return a0_0x2829f2(()=>new Date()['toLocaleDateString'](a0_0x5e6cee)['replace'](/\d/g,'')['split']('')[0x0]);}['cpy'](){return a0_0x2829f2(()=>a0_0x51d49d['new']()['setTime'](this['toTime']()));}['setCode'](_0x41f3a1){return this['_code']=_0x41f3a1,this;}['setZone'](_0x5b911f){return this['_zone']=_0x5b911f,this;}['seperator'](){return a0_0x2829f2(()=>new Date()['toLocaleDateString'](this['_code'])['replace'](/\d/g,'')['split']('')[0x0]);}['timezone'](){return a0_0x2829f2(()=>{return this['zone']||Intl['DateTimeFormat']()?.['resolvedOptions']()?.['timeZone'];},null);}['zones'](_0x3eeac1=this['_code']){return a0_0x2829f2(()=>{return new Intl['Locale'](_0x3eeac1)?.['timeZones']||[];},null);}['region'](_0x22c436=this['_code']){return a0_0x2829f2(()=>{return new Intl['Locale'](_0x22c436)['region'];},null);}['year'](){return this['val']['year'];}['month'](){return this['val']['month'];}['monthUtc'](){return this['val']['month']-0x1;}['day'](){return this['val']['day'];}['hours'](){return this['val']['hour'];}['min'](){return this['val']['minute'];}['sec'](){return this['val']['second'];}['msec'](){return this['val']['millisecond'];}['dayOfWeek'](){const _0x233f1e=this['val']['dayOfWeek'];return _0x233f1e?_0x233f1e:0x7;}['dayOfWeekUtc'](){return this['val']['dayOfWeek']-0x1;}['setYear'](_0x20e8d){const _0x5b9c57={};return _0x5b9c57['year']=_0x20e8d,this['val']=this['val']['with'](_0x5b9c57),this;}['setMonth'](_0x3434e3){const _0x4c7306={};return _0x4c7306['month']=_0x3434e3,this['val']=this['val']['with'](_0x4c7306),this;}['setMonthUtc'](_0x1c9abc){const _0x97a580={};return _0x97a580['month']=_0x1c9abc+0x1,this['val']=this['val']['with'](_0x97a580),this;}['setDay'](_0xf20e0){const _0x258da6={};return _0x258da6['day']=_0xf20e0,this['val']=this['val']['with'](_0x258da6),this;}['setHour'](_0xe4193e){const _0x212944={};return _0x212944['hour']=_0xe4193e,this['val']=this['val']['with'](_0x212944),this;}['startOfHours'](){return this['setMin'](0x0),this['setSeconds'](0x0),this['setMilliseconds'](0x0),this;}['endOfHours'](){return this['setMin'](0x3b),this['setSeconds'](0x3b),this['setMilliseconds'](0x3e7),this;}['setMin'](_0x24e80c){const _0x4e3842={};return _0x4e3842['minute']=_0x24e80c,this['val']=this['val']['with'](_0x4e3842),this;}['startOfMin'](){return this['setSeconds'](0x0),this['setMilliseconds'](0x0),this;}['endOfMin'](){return this['setSeconds'](0x3b),this['setMilliseconds'](0x3e7),this;}['setSeconds'](_0x2695e6){const _0x41f46a={};return _0x41f46a['second']=_0x2695e6,this['val']=this['val']['with'](_0x41f46a),this;}['startOfSeconds'](){return this['setMilliseconds'](0x0),this;}['endOfSeconds'](){return this['setMilliseconds'](0x3e7),this;}['setMilliseconds'](_0x4c9f92){const _0x554c37={};return _0x554c37['millisecond']=_0x4c9f92,this['val']=this['val']['with'](_0x554c37),this;}['startOfMilliseconds'](){return this['setMilliseconds'](0x0),this;}['endOfMilliseconds'](){return this['setMilliseconds'](0x3e7),this;}['setIsoDate'](_0x88fac1){const _0x3cd792=_0x88fac1?new Date(_0x88fac1?.['replace']('T','\x20')):new Date();return this['val']=a0_0x1d23d0['Temporal']['Instant']['from'](_0x3cd792['toISOString']())['toZonedDateTimeISO'](this['zone']),this;}['setTime'](_0x22c431){return this['val']=a0_0x1d23d0['Temporal']['Instant']['fromEpochMilliseconds'](_0x22c431||new Date()['getTime']())['toZonedDateTimeISO'](this['zone']),this;}['setDate'](_0x20e1d2){return this['setIsoDate'](_0x20e1d2?.['toISOString']()),this;}['setDateInputValue'](_0x45e2ab){const _0x540b75=_0x45e2ab?new Date(_0x45e2ab?.['replace']('T','\x20')):new Date();return _0x540b75['getTime']()&&(this['val']=a0_0x1d23d0['Temporal']['Instant']['from'](_0x540b75?.['toISOString']())['toZonedDateTimeISO'](this['zone']),this['with'](_0x540b75)),this;}['setVal'](_0x454647){return a0_0x2829f2(()=>{return a0_0x51d49d['new']()['setTime'](a0_0xf07824(_0x454647,this['zone']));});}['toIsoDate'](){const _0x42abf1={};return _0x42abf1['fractionalSecondDigits']=0x3,this['val']['toInstant']()['toString'](_0x42abf1);}['toIsoDateZone'](){return this['val']['toString']()['substring'](0x0,0x1d)+'Z';}['toTime'](){return this['val']['epochMilliseconds'];}['toDate'](){return new Date(this['val']['toInstant']()['epochMilliseconds']);}['toDateMounthInput'](){return this['year']()+'-'+a0_0x558bea(this['month']());}['toDateInput'](){return this['year']()+'-'+a0_0x558bea(this['month']())+'-'+a0_0x558bea(this['day']());}['toTimeInput'](_0x49904b=!![]){const _0x50b13d=[];return _0x50b13d['push'](a0_0x558bea(this['hours']())),_0x50b13d['push'](a0_0x558bea(this['min']())),_0x49904b&&_0x50b13d['push'](a0_0x558bea(this['sec']())),_0x50b13d['join'](':');}['toDateTimeInput'](_0x3dbf3f=!![]){return this['toDateInput']()+'T'+this['toTimeInput'](_0x3dbf3f);}['toAs'](){return this['val']['toInstant']()['toString']();}['strDate'](){const _0x4a9326={};return _0x4a9326['month']='2-digit',_0x4a9326['day']='2-digit',_0x4a9326['year']='numeric',this['val']['toLocaleString'](this['_code'],_0x4a9326);}['strTime'](){return a0_0x558bea(this['hours']())+':'+a0_0x558bea(this['min']())+':'+a0_0x558bea(this['sec']());}['strHHmm'](){return a0_0x558bea(this['hours']())+':'+a0_0x558bea(this['min']());}['str'](){return this['strDate']()+'\x20'+this['strTime']();}['strLocal'](_0x1d0b2e){return this['val']['toLocaleString'](this['_code'],_0x1d0b2e);}['strYears'](){return this['val']['year']['toString']();}['strMounth'](){return a0_0x558bea(this['month'](),0x2);}['strDay'](){return a0_0x558bea(this['day'](),0x2);}['strHour'](){return a0_0x558bea(this['hours'](),0x2);}['strMin'](){return a0_0x558bea(this['min'](),0x2);}['strSec'](){return a0_0x558bea(this['sec'](),0x2);}['strMsec'](){return a0_0x558bea(this['msec'](),0x2);}['strDayStr'](){return{'ln':()=>this['dyfrmt']['ln'](),'sh':()=>this['dyfrmt']['sh'](),'nr':()=>this['dyfrmt']['nr']()};}['addDay'](_0x22deec){const _0x1b50a6={};return _0x1b50a6['days']=_0x22deec,this['val']=this['val']['add'](_0x1b50a6),this;}['addHours'](_0x3bdb68){const _0x4d3344={};return _0x4d3344['hours']=_0x3bdb68,this['val']=this['val']['add'](_0x4d3344),this;}['addMins'](_0x2eb613){const _0x450bc7={};return _0x450bc7['minutes']=_0x2eb613,this['val']=this['val']['add'](_0x450bc7),this;}['startOfDay'](){return this['setHour'](0x0),this['startOfHours'](),this;}['cpyByStartOfDay'](){return this['cpy']()['startOfDay']();}['endOfDay'](){return this['setHour'](0x17),this['endOfHours'](),this;}['cpyByEndOfDay'](){return this['cpy']()['endOfDay']();}['startOfWeek'](){return this['addDay'](-this['dayOfWeek']()+0x1);}['cpyStartOfWeek'](){return this['cpy']()['addDay'](-this['dayOfWeek']()+0x1);}['endOfWeek'](){return this['startOfWeek']()['addDay'](0x6);}['cpyEndOfWeek'](){return this['cpyStartOfWeek']()['addDay'](0x6);}['startOfMonth'](){return this['setDay'](0x1),this['startOfDay'](),this;}['cpyByStartOfMonth'](){return this['cpy']()['startOfMonth']();}['endOfMonth'](){return this['setTime'](this['val']['epochMilliseconds'])['startOfMonth']()['setMonth'](this['month']()+0x1)['startOfMonth']()['addDay'](-0x1)['endOfDay'](),this;}['cpyByEndOfMonth'](){return this['cpy']()['endOfMonth']();}['eq'](_0x3249e3){return a0_0x2829f2(()=>{return this['cpy']()['toTime']()===a0_0xf07824(_0x3249e3,this['zone']);});}['gt'](_0x5d195a){return a0_0x2829f2(()=>{return this['cpy']()['toTime']()>a0_0xf07824(_0x5d195a,this['zone']);});}['gte'](_0x2e5647){return a0_0x2829f2(()=>{return this['cpy']()['toTime']()>=a0_0xf07824(_0x2e5647,this['zone']);});}['lt'](_0x28108e){return a0_0x2829f2(()=>{return this['cpy']()['toTime']()<a0_0xf07824(_0x28108e,this['zone']);});}['lte'](_0x3e715a){return a0_0x2829f2(()=>{return this['cpy']()['toTime']()<=a0_0xf07824(_0x3e715a,this['zone']);});}['btw'](_0x2c7ac9,_0x509e06){return a0_0x2829f2(()=>{const _0x11d314=a0_0xf07824(_0x2c7ac9,this['zone']),_0x338c4c=a0_0xf07824(_0x509e06,this['zone']),_0x1a46e3=this['cpy']()['toTime']();return _0x11d314<_0x1a46e3&&_0x1a46e3<_0x338c4c;});}['btweq'](_0x64eac0,_0x3963a3){return a0_0x2829f2(()=>{const _0x57326a=a0_0xf07824(_0x64eac0,this['zone']),_0x10fc3c=a0_0xf07824(_0x3963a3,this['zone']),_0x2fef27=this['cpy']()['toTime']();return _0x57326a<=_0x2fef27&&_0x2fef27<=_0x10fc3c;});}['btwEqStart'](_0x2d0784,_0x25c92c){return a0_0x2829f2(()=>{const _0x5b8a72=a0_0xf07824(_0x2d0784,this['zone']),_0x409aac=a0_0xf07824(_0x25c92c,this['zone']),_0x314617=this['cpy']()['toTime']();return _0x5b8a72<=_0x314617&&_0x314617<_0x409aac;});}['btwEqEnd'](_0xfa5f85,_0x30c32e){return a0_0x2829f2(()=>{const _0x1b5e0a=a0_0xf07824(_0xfa5f85,this['zone']),_0x5ee0be=a0_0xf07824(_0x30c32e,this['zone']),_0x2cb826=this['cpy']()['toTime']();return _0x1b5e0a<_0x2cb826&&_0x2cb826<=_0x5ee0be;});}static['diffDays'](_0x16b929,_0x196af5,_0xf47e6c){return a0_0x2829f2(()=>{const _0x276b16=a0_0xf07824(_0x16b929,a0_0x141411),_0x4887f9=a0_0xf07824(_0x196af5,a0_0x141411);return _0xf47e6c?Math['abs'](_0x276b16-_0x4887f9)/0x36ee80/0x18:(_0x276b16-_0x4887f9)/0x36ee80/0x18;});}static['diffHours'](_0x6ded0c,_0x3682a2,_0x53713a){return a0_0x2829f2(()=>{const _0x6635f2=a0_0xf07824(_0x6ded0c,a0_0x141411),_0x1b4c78=a0_0xf07824(_0x3682a2,a0_0x141411);return _0x53713a?Math['abs'](_0x6635f2-_0x1b4c78)/0x36ee80:(_0x6635f2-_0x1b4c78)/0x36ee80;});}static['diffMins'](_0x32c1a6,_0x39b3b3,_0x28db28){return a0_0x2829f2(()=>{const _0x19a29d=a0_0xf07824(_0x32c1a6,a0_0x141411),_0xaf7dc0=a0_0xf07824(_0x39b3b3,a0_0x141411);return _0x28db28?Math['abs'](_0x19a29d-_0xaf7dc0)/0x3e8/0x3c:(_0x19a29d-_0xaf7dc0)/0x3e8/0x3c;});}static['diffSecs'](_0x2e17c2,_0x94f05,_0x398365){return a0_0x2829f2(()=>{const _0x2268a6=a0_0xf07824(_0x2e17c2,a0_0x141411),_0x16ab43=a0_0xf07824(_0x94f05,a0_0x141411);return _0x398365?Math['abs'](_0x2268a6-_0x16ab43)/0x3e8:(_0x2268a6-_0x16ab43)/0x3e8;});}static['divideTime'](_0x21208c){return a0_0x2829f2(()=>a0_0x392557(_0x21208c));}}exports['MDateUtil']=a0_0x51d49d;const a0_0x2c0102={};a0_0x2c0102['value']='MDateUtil',a0_0x2c0102['writable']=![],a0_0x2c0102['enumerable']=!![],a0_0x2c0102['configurable']=![],Object['defineProperty'](a0_0x51d49d['prototype'],'idkey',a0_0x2c0102);
|
|
1
|
+
'use strict';const a0_0x39759e={};a0_0x39759e['value']=!![],Object['defineProperty'](exports,'__esModule',a0_0x39759e),exports['MDateUtil']=void 0x0;const a0_0x2b9bec=require('@js-temporal/polyfill'),a0_0x2d036e=(_0x249551,_0xb0536f=0x2)=>_0x249551['toString']()['padStart'](_0xb0536f,'0');function a0_0x77811f(_0x10e528,_0x2523d1){try{return _0x10e528();}catch(_0x488004){if(_0x2523d1)return _0x2523d1;throw new Error('UNKNOWN');}}function a0_0x5f1b17(_0x5f2798,_0x3a0d66){try{if(_0x5f2798 instanceof Date)return a0_0x2b9bec['Temporal']['Instant']['fromEpochMilliseconds'](_0x5f2798['getTime']())['toZonedDateTimeISO'](_0x3a0d66)['epochMilliseconds'];if(typeof _0x5f2798==='number')return _0x5f2798;if(typeof _0x5f2798==='string')return a0_0x2b9bec['Temporal']['Instant']['fromEpochMilliseconds'](new Date(_0x5f2798)['getTime']())['toZonedDateTimeISO'](_0x3a0d66)['epochMilliseconds'];if(_0x5f2798 instanceof a0_0x22ddb2)return _0x5f2798['toTime']();if(_0x5f2798['idkey']==='MDateUtil')return _0x5f2798['toTime']();return 0x0;}catch(_0x2281f8){throw new Error('ERROR');}}function a0_0x298a0d(_0x313074){function _0x2fce1d(_0x1cc348){const _0x509aa6={};return _0x509aa6['weekday']=_0x1cc348,a0_0x77811f(()=>new Intl['DateTimeFormat'](_0x313074['localCode'],_0x509aa6)['format'](a0_0x5f1b17(_0x313074,_0x313074['zone'])),'');}function _0x325456(){return _0x2fce1d('long');}function _0x15cf74(){return _0x2fce1d('short');}function _0x10e531(){return _0x2fce1d('narrow');}const _0x221ab6={};return _0x221ab6['ln']=_0x325456,_0x221ab6['sh']=_0x15cf74,_0x221ab6['nr']=_0x10e531,_0x221ab6;}function a0_0x4dfee0(_0x5ea45e){let _0x470553=undefined,_0x33b1d2=undefined,_0x1c2355=undefined,_0x515a2e=undefined;try{const _0x23a0db=(_0x5ea45e||'')['match'](/\w{2}:\w{2}(:\w{2})?\b/g)[0x0]['split'](':');_0x470553=_0x23a0db['length']>=0x1?Number(_0x23a0db[0x0]):undefined,_0x33b1d2=_0x23a0db['length']>=0x2?Number(_0x23a0db[0x1]):undefined,_0x1c2355=_0x23a0db['length']>=0x3?Number(_0x23a0db[0x2]):undefined;}catch(_0x50ebfd){}try{let _0x28faf7=_0x5ea45e||'',_0x2a1522=/\.\d{3}/g,_0x15fb1b=_0x28faf7['match'](_0x2a1522)[0x0]['split']('.')['filter'](_0xe13420=>Boolean(_0xe13420));_0x515a2e=_0x15fb1b['length']>=0x1?Number(_0x15fb1b[0x0]):undefined;}catch(_0x9643a4){}const _0x2ddef5={};return _0x2ddef5['h']=_0x470553,_0x2ddef5['m']=_0x33b1d2,_0x2ddef5['s']=_0x1c2355,_0x2ddef5['ms']=_0x515a2e,_0x2ddef5;}let a0_0x30cdbf=Intl['NumberFormat']()['resolvedOptions']()['locale'],a0_0x4d1b2e=Intl['DateTimeFormat']()['resolvedOptions']()['timeZone'];function a0_0x14fea8(_0x1285b7){return Number(Number(NaN)['toFixed'](0x0))||0x0;}class a0_0x22ddb2{['val'];['_code']=Intl['NumberFormat']()['resolvedOptions']()['locale'];['_zone']=Intl['DateTimeFormat']()['resolvedOptions']()['timeZone'];['dyfrmt']=a0_0x298a0d(this);get['localCode'](){return this['_code'];}get['zone'](){return this['_zone'];}['with'](_0x5e69af){this['val']=this['val']['with']({'year':_0x5e69af['getFullYear'](),'month':_0x5e69af['getMonth']()+0x1,'day':_0x5e69af['getDate'](),'hour':_0x5e69af['getHours'](),'minute':_0x5e69af['getMinutes'](),'second':_0x5e69af['getSeconds'](),'millisecond':_0x5e69af['getMilliseconds']()});}['init'](){const _0x1ed92c=new Date();return this['val']=a0_0x2b9bec['Temporal']['Instant']['from'](_0x1ed92c['toISOString']())['toZonedDateTimeISO'](this['zone']),this['dyfrmt']=a0_0x298a0d(this),this;}['toString'](){return'---';}static['new'](){return new a0_0x22ddb2()['setCode'](a0_0x30cdbf)['setZone'](a0_0x4d1b2e)['init']();}static['setCode'](_0x51bb25){return a0_0x30cdbf=_0x51bb25,this;}static['setZone'](_0xcd986b){return a0_0x4d1b2e=_0xcd986b,this;}static['seperator'](){return a0_0x77811f(()=>new Date()['toLocaleDateString'](a0_0x30cdbf)['replace'](/\d/g,'')['split']('')[0x0]);}['cpy'](){return a0_0x77811f(()=>a0_0x22ddb2['new']()['setTime'](this['toTime']()));}['setCode'](_0x1731fa){return this['_code']=_0x1731fa,this;}['setZone'](_0x3f8f55){return this['_zone']=_0x3f8f55,this;}['seperator'](){return a0_0x77811f(()=>new Date()['toLocaleDateString'](this['_code'])['replace'](/\d/g,'')['split']('')[0x0]);}['timezone'](){return a0_0x77811f(()=>{return this['zone']||Intl['DateTimeFormat']()?.['resolvedOptions']()?.['timeZone'];},null);}['zones'](_0x122011=this['_code']){return a0_0x77811f(()=>{return new Intl['Locale'](_0x122011)?.['timeZones']||[];},null);}['region'](_0x1750c3=this['_code']){return a0_0x77811f(()=>{return new Intl['Locale'](_0x1750c3)['region'];},null);}['year'](){return this['val']['year'];}['month'](){return this['val']['month'];}['monthUtc'](){return this['val']['month']-0x1;}['day'](){return this['val']['day'];}['hours'](){return this['val']['hour'];}['min'](){return this['val']['minute'];}['sec'](){return this['val']['second'];}['msec'](){return this['val']['millisecond'];}['dayOfWeek'](){const _0x3735aa=this['val']['dayOfWeek'];return _0x3735aa?_0x3735aa:0x7;}['dayOfWeekUtc'](){return this['val']['dayOfWeek']-0x1;}['setYear'](_0x439aa5){return this['val']=this['val']['with']({'year':a0_0x14fea8(_0x439aa5)}),this;}['setMonth'](_0x43f502){return this['val']=this['val']['with']({'month':a0_0x14fea8(_0x43f502)}),this;}['setMonthUtc'](_0x402e98){return this['val']=this['val']['with']({'month':a0_0x14fea8(_0x402e98)+0x1}),this;}['setDay'](_0x5d1d1d){return this['val']=this['val']['with']({'day':a0_0x14fea8(_0x5d1d1d)}),this;}['setHour'](_0x32af70){return this['val']=this['val']['with']({'hour':a0_0x14fea8(_0x32af70)}),this;}['startOfHours'](){return this['setMin'](0x0),this['setSeconds'](0x0),this['setMilliseconds'](0x0),this;}['endOfHours'](){return this['setMin'](0x3b),this['setSeconds'](0x3b),this['setMilliseconds'](0x3e7),this;}['setMin'](_0x33d482){return this['val']=this['val']['with']({'minute':a0_0x14fea8(_0x33d482)}),this;}['startOfMin'](){return this['setSeconds'](0x0),this['setMilliseconds'](0x0),this;}['endOfMin'](){return this['setSeconds'](0x3b),this['setMilliseconds'](0x3e7),this;}['setSeconds'](_0x576397){return this['val']=this['val']['with']({'second':a0_0x14fea8(_0x576397)}),this;}['startOfSeconds'](){return this['setMilliseconds'](0x0),this;}['endOfSeconds'](){return this['setMilliseconds'](0x3e7),this;}['setMilliseconds'](_0x5bf57f){return this['val']=this['val']['with']({'millisecond':a0_0x14fea8(_0x5bf57f)}),this;}['startOfMilliseconds'](){return this['setMilliseconds'](0x0),this;}['endOfMilliseconds'](){return this['setMilliseconds'](0x3e7),this;}['setIsoDate'](_0x3271aa){const _0x474c41=_0x3271aa?new Date(_0x3271aa?.['replace']('T','\x20')):new Date();return this['val']=a0_0x2b9bec['Temporal']['Instant']['from'](_0x474c41['toISOString']())['toZonedDateTimeISO'](this['zone']),this;}['setTime'](_0x2a8a6e){return this['val']=a0_0x2b9bec['Temporal']['Instant']['fromEpochMilliseconds'](_0x2a8a6e||new Date()['getTime']())['toZonedDateTimeISO'](this['zone']),this;}['setDate'](_0x5e2daa){return this['setIsoDate'](_0x5e2daa?.['toISOString']()),this;}['setDateInputValue'](_0x51342){const _0x5c55e5=_0x51342?new Date(_0x51342?.['replace']('T','\x20')):new Date();return _0x5c55e5['getTime']()&&(this['val']=a0_0x2b9bec['Temporal']['Instant']['from'](_0x5c55e5?.['toISOString']())['toZonedDateTimeISO'](this['zone']),this['with'](_0x5c55e5)),this;}['setVal'](_0x31b8ae){return a0_0x77811f(()=>{return a0_0x22ddb2['new']()['setTime'](a0_0x5f1b17(_0x31b8ae,this['zone']));});}['toIsoDate'](){const _0x3759c6={};return _0x3759c6['fractionalSecondDigits']=0x3,this['val']['toInstant']()['toString'](_0x3759c6);}['toIsoDateZone'](){return this['val']['toString']()['substring'](0x0,0x1d)+'Z';}['toTime'](){return this['val']['epochMilliseconds'];}['toDate'](){return new Date(this['val']['toInstant']()['epochMilliseconds']);}['toDateMounthInput'](){return this['year']()+'-'+a0_0x2d036e(this['month']());}['toDateInput'](){return this['year']()+'-'+a0_0x2d036e(this['month']())+'-'+a0_0x2d036e(this['day']());}['toTimeInput'](_0x38748a=!![]){const _0x493e17=[];return _0x493e17['push'](a0_0x2d036e(this['hours']())),_0x493e17['push'](a0_0x2d036e(this['min']())),_0x38748a&&_0x493e17['push'](a0_0x2d036e(this['sec']())),_0x493e17['join'](':');}['toDateTimeInput'](_0x232ebe=!![]){return this['toDateInput']()+'T'+this['toTimeInput'](_0x232ebe);}['toAs'](){return this['val']['toInstant']()['toString']();}['strDate'](){const _0x5eb306={};return _0x5eb306['month']='2-digit',_0x5eb306['day']='2-digit',_0x5eb306['year']='numeric',this['val']['toLocaleString'](this['_code'],_0x5eb306);}['strTime'](){return a0_0x2d036e(this['hours']())+':'+a0_0x2d036e(this['min']())+':'+a0_0x2d036e(this['sec']());}['strHHmm'](){return a0_0x2d036e(this['hours']())+':'+a0_0x2d036e(this['min']());}['str'](){return this['strDate']()+'\x20'+this['strTime']();}['strLocal'](_0x456bf7){return this['val']['toLocaleString'](this['_code'],_0x456bf7);}['strYears'](){return this['val']['year']['toString']();}['strMounth'](){return a0_0x2d036e(this['month'](),0x2);}['strDay'](){return a0_0x2d036e(this['day'](),0x2);}['strHour'](){return a0_0x2d036e(this['hours'](),0x2);}['strMin'](){return a0_0x2d036e(this['min'](),0x2);}['strSec'](){return a0_0x2d036e(this['sec'](),0x2);}['strMsec'](){return a0_0x2d036e(this['msec'](),0x2);}['strDayStr'](){return{'ln':()=>this['dyfrmt']['ln'](),'sh':()=>this['dyfrmt']['sh'](),'nr':()=>this['dyfrmt']['nr']()};}['addDay'](_0x28544a){return this['addHours'](Number(_0x28544a)*0x18),this;}['addHours'](_0x37f5ef){return this['addMins'](Number(_0x37f5ef)*0x3c),this;}['addMins'](_0x7dc1ff){return this['addSecs'](Number(_0x7dc1ff)*0x3c),this;}['addSecs'](_0x49a5d5){return this['addMilliseconds'](Number(_0x49a5d5)*0x3e8),this;}['addMilliseconds'](_0x501768){return this['val']=this['val']['add']({'milliseconds':a0_0x14fea8(_0x501768)}),this;}['startOfDay'](){return this['setHour'](0x0),this['startOfHours'](),this;}['cpyByStartOfDay'](){return this['cpy']()['startOfDay']();}['endOfDay'](){return this['setHour'](0x17),this['endOfHours'](),this;}['cpyByEndOfDay'](){return this['cpy']()['endOfDay']();}['startOfWeek'](){return this['addDay'](-this['dayOfWeek']()+0x1);}['cpyStartOfWeek'](){return this['cpy']()['addDay'](-this['dayOfWeek']()+0x1);}['endOfWeek'](){return this['startOfWeek']()['addDay'](0x6);}['cpyEndOfWeek'](){return this['cpyStartOfWeek']()['addDay'](0x6);}['startOfMonth'](){return this['setDay'](0x1),this['startOfDay'](),this;}['cpyByStartOfMonth'](){return this['cpy']()['startOfMonth']();}['endOfMonth'](){return this['setTime'](this['val']['epochMilliseconds'])['startOfMonth']()['setMonth'](this['month']()+0x1)['startOfMonth']()['addDay'](-0x1)['endOfDay'](),this;}['cpyByEndOfMonth'](){return this['cpy']()['endOfMonth']();}['eq'](_0x297e69){return a0_0x77811f(()=>{return this['cpy']()['toTime']()===a0_0x5f1b17(_0x297e69,this['zone']);});}['gt'](_0x3cd2db){return a0_0x77811f(()=>{return this['cpy']()['toTime']()>a0_0x5f1b17(_0x3cd2db,this['zone']);});}['gte'](_0x4f797f){return a0_0x77811f(()=>{return this['cpy']()['toTime']()>=a0_0x5f1b17(_0x4f797f,this['zone']);});}['lt'](_0x4bbae1){return a0_0x77811f(()=>{return this['cpy']()['toTime']()<a0_0x5f1b17(_0x4bbae1,this['zone']);});}['lte'](_0x3f1191){return a0_0x77811f(()=>{return this['cpy']()['toTime']()<=a0_0x5f1b17(_0x3f1191,this['zone']);});}['btw'](_0x113fb3,_0x5df044){return a0_0x77811f(()=>{const _0x401a0b=a0_0x5f1b17(_0x113fb3,this['zone']),_0x2f4761=a0_0x5f1b17(_0x5df044,this['zone']),_0x10174f=this['cpy']()['toTime']();return _0x401a0b<_0x10174f&&_0x10174f<_0x2f4761;});}['btweq'](_0x1da9b1,_0x321717){return a0_0x77811f(()=>{const _0x1f36a7=a0_0x5f1b17(_0x1da9b1,this['zone']),_0xff62f4=a0_0x5f1b17(_0x321717,this['zone']),_0x3967c7=this['cpy']()['toTime']();return _0x1f36a7<=_0x3967c7&&_0x3967c7<=_0xff62f4;});}['btwEqStart'](_0x4e6b9c,_0x3fe8ed){return a0_0x77811f(()=>{const _0x544cde=a0_0x5f1b17(_0x4e6b9c,this['zone']),_0xeba749=a0_0x5f1b17(_0x3fe8ed,this['zone']),_0x3ce729=this['cpy']()['toTime']();return _0x544cde<=_0x3ce729&&_0x3ce729<_0xeba749;});}['btwEqEnd'](_0x4f4f08,_0x31924b){return a0_0x77811f(()=>{const _0x2ebff7=a0_0x5f1b17(_0x4f4f08,this['zone']),_0x1dde92=a0_0x5f1b17(_0x31924b,this['zone']),_0xaafff6=this['cpy']()['toTime']();return _0x2ebff7<_0xaafff6&&_0xaafff6<=_0x1dde92;});}static['diffDays'](_0x5166b1,_0x41e902,_0x5d58d6){return a0_0x77811f(()=>{const _0x2c19f4=a0_0x5f1b17(_0x5166b1,a0_0x4d1b2e),_0x4353a2=a0_0x5f1b17(_0x41e902,a0_0x4d1b2e);return _0x5d58d6?Math['abs'](_0x2c19f4-_0x4353a2)/0x36ee80/0x18:(_0x2c19f4-_0x4353a2)/0x36ee80/0x18;});}static['diffHours'](_0x38fc90,_0x239cd3,_0x149e38){return a0_0x77811f(()=>{const _0x11bd98=a0_0x5f1b17(_0x38fc90,a0_0x4d1b2e),_0x489c4f=a0_0x5f1b17(_0x239cd3,a0_0x4d1b2e);return _0x149e38?Math['abs'](_0x11bd98-_0x489c4f)/0x36ee80:(_0x11bd98-_0x489c4f)/0x36ee80;});}static['diffMins'](_0x5ba7f0,_0x52a10b,_0x57116f){return a0_0x77811f(()=>{const _0x15ccca=a0_0x5f1b17(_0x5ba7f0,a0_0x4d1b2e),_0x43f6f6=a0_0x5f1b17(_0x52a10b,a0_0x4d1b2e);return _0x57116f?Math['abs'](_0x15ccca-_0x43f6f6)/0x3e8/0x3c:(_0x15ccca-_0x43f6f6)/0x3e8/0x3c;});}static['diffSecs'](_0x220b62,_0x506e5b,_0x148b28){return a0_0x77811f(()=>{const _0x39c4b3=a0_0x5f1b17(_0x220b62,a0_0x4d1b2e),_0x566dbd=a0_0x5f1b17(_0x506e5b,a0_0x4d1b2e);return _0x148b28?Math['abs'](_0x39c4b3-_0x566dbd)/0x3e8:(_0x39c4b3-_0x566dbd)/0x3e8;});}static['divideTime'](_0x1fd3c5){return a0_0x77811f(()=>a0_0x4dfee0(_0x1fd3c5));}}exports['MDateUtil']=a0_0x22ddb2;const a0_0x4dfdd7={};a0_0x4dfdd7['value']='MDateUtil',a0_0x4dfdd7['writable']=![],a0_0x4dfdd7['enumerable']=!![],a0_0x4dfdd7['configurable']=![],Object['defineProperty'](a0_0x22ddb2['prototype'],'idkey',a0_0x4dfdd7);
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var a0_0x12f63a=this&&this['__createBinding']||(Object['create']?function(_0x45c52f,_0x1fad48,_0x117577,_0x238cab){if(_0x238cab===undefined)_0x238cab=_0x117577;var _0x18525c=Object['getOwnPropertyDescriptor'](_0x1fad48,_0x117577);if(!_0x18525c||('get'in _0x18525c?!_0x1fad48['__esModule']:_0x18525c['writable']||_0x18525c['configurable'])){var _0x342bbe={};_0x342bbe['enumerable']=!![],_0x342bbe['get']=function(){return _0x1fad48[_0x117577];},_0x18525c=_0x342bbe;}Object['defineProperty'](_0x45c52f,_0x238cab,_0x18525c);}:function(_0x37669c,_0x29296d,_0x165aba,_0x132d03){if(_0x132d03===undefined)_0x132d03=_0x165aba;_0x37669c[_0x132d03]=_0x29296d[_0x165aba];}),a0_0x59f996=this&&this['__exportStar']||function(_0xf3781,_0x1c9a75){for(var _0x56e8d5 in _0xf3781)if(_0x56e8d5!=='default'&&!Object['prototype']['hasOwnProperty']['call'](_0x1c9a75,_0x56e8d5))a0_0x12f63a(_0x1c9a75,_0xf3781,_0x56e8d5);},a0_0x574e69={};a0_0x574e69['value']=!![],Object['defineProperty'](exports,'__esModule',a0_0x574e69),a0_0x59f996(require('./DateUtil'),exports);
|