mat-date 1.8.17 → 1.8.88
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 +3 -1
- package/dist/DateUtil.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/DateUtil.d.ts
CHANGED
|
@@ -16,11 +16,12 @@ interface IStrOptions {
|
|
|
16
16
|
}
|
|
17
17
|
export declare class MDateUtil {
|
|
18
18
|
private val;
|
|
19
|
-
private
|
|
19
|
+
private _code;
|
|
20
20
|
private _zone;
|
|
21
21
|
private dyfrmt;
|
|
22
22
|
get localCode(): string;
|
|
23
23
|
get zone(): string;
|
|
24
|
+
private with;
|
|
24
25
|
private init;
|
|
25
26
|
toString(): string;
|
|
26
27
|
static new(): MDateUtil;
|
|
@@ -73,6 +74,7 @@ export declare class MDateUtil {
|
|
|
73
74
|
toDateInput(): string;
|
|
74
75
|
toTimeInput(byS?: boolean): any;
|
|
75
76
|
toDateTimeInput(byS?: boolean): string;
|
|
77
|
+
toAs(): string;
|
|
76
78
|
strDate(): string;
|
|
77
79
|
strTime(): string;
|
|
78
80
|
strHHmm(): string;
|
package/dist/DateUtil.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x43c826={};a0_0x43c826['value']=!![],Object['defineProperty'](exports,'__esModule',a0_0x43c826),exports['MDateUtil']=void 0x0;const a0_0x3bb990=require('@js-temporal/polyfill'),a0_0x1ee0ad=(_0x58b873,_0x11553a=0x2)=>_0x58b873['toString']()['padStart'](_0x11553a,'0');function a0_0x4b7070(_0x2989e8,_0xe95ae2){try{return _0x2989e8();}catch(_0x3de977){if(_0xe95ae2)return _0xe95ae2;throw new Error('UNKNOWN');}}function a0_0xaa8d36(_0x104a68,_0x4654d1){try{if(_0x104a68 instanceof Date)return a0_0x3bb990['Temporal']['Instant']['fromEpochMilliseconds'](_0x104a68['getTime']())['toZonedDateTimeISO'](_0x4654d1)['epochMilliseconds'];if(typeof _0x104a68==='number')return _0x104a68;if(typeof _0x104a68==='string')return a0_0x3bb990['Temporal']['Instant']['fromEpochMilliseconds'](new Date(_0x104a68)['getTime']())['toZonedDateTimeISO'](_0x4654d1)['epochMilliseconds'];if(_0x104a68 instanceof a0_0x342409)return _0x104a68['toTime']();if(_0x104a68['idkey']==='mdateutil')return _0x104a68['toTime']();return 0x0;}catch(_0x1f6822){throw new Error('ERROR');}}function a0_0xf00a23(_0xa5671d){function _0x16e02f(_0x4edf0a){const _0x224c12={};return _0x224c12['weekday']=_0x4edf0a,a0_0x4b7070(()=>new Intl['DateTimeFormat'](_0xa5671d['localCode'],_0x224c12)['format'](a0_0xaa8d36(_0xa5671d,_0xa5671d['zone'])),'');}function _0x5ebd2a(){return _0x16e02f('long');}function _0x524221(){return _0x16e02f('short');}function _0x18a35e(){return _0x16e02f('narrow');}const _0x2849f0={};return _0x2849f0['ln']=_0x5ebd2a,_0x2849f0['sh']=_0x524221,_0x2849f0['nr']=_0x18a35e,_0x2849f0;}function a0_0x2b7828(_0x3018c4){let _0x40efd1=undefined,_0x28b1f9=undefined,_0x13d1dc=undefined,_0x3898d5=undefined;try{const _0x488006=(_0x3018c4||'')['match'](/\w{2}:\w{2}(:\w{2})?\b/g)[0x0]['split'](':');_0x40efd1=_0x488006['length']>=0x1?Number(_0x488006[0x0]):undefined,_0x28b1f9=_0x488006['length']>=0x2?Number(_0x488006[0x1]):undefined,_0x13d1dc=_0x488006['length']>=0x3?Number(_0x488006[0x2]):undefined;}catch(_0x14423f){}try{let _0x4f81ed=_0x3018c4||'',_0x49cb08=/\.\d{3}/g,_0x533b61=_0x4f81ed['match'](_0x49cb08)[0x0]['split']('.')['filter'](_0x423225=>Boolean(_0x423225));_0x3898d5=_0x533b61['length']>=0x1?Number(_0x533b61[0x0]):undefined;}catch(_0xeb86d9){}const _0x353da8={};return _0x353da8['h']=_0x40efd1,_0x353da8['m']=_0x28b1f9,_0x353da8['s']=_0x13d1dc,_0x353da8['ms']=_0x3898d5,_0x353da8;}let a0_0x1eac19=Intl['NumberFormat']()['resolvedOptions']()['locale'],a0_0x4a637f=Intl['DateTimeFormat']()['resolvedOptions']()['timeZone'];class a0_0x342409{['val'];['code']=Intl['NumberFormat']()['resolvedOptions']()['locale'];['_zone']=Intl['DateTimeFormat']()['resolvedOptions']()['timeZone'];['dyfrmt']=a0_0xf00a23(this);get['localCode'](){return this['code'];}get['zone'](){return this['_zone'];}['init'](){return this['val']=a0_0x3bb990['Temporal']['Instant']['fromEpochMilliseconds'](new Date()['getTime']())['toZonedDateTimeISO'](this['zone']),this['dyfrmt']=a0_0xf00a23(this),this;}['toString'](){return'TEST';}static['new'](){return new a0_0x342409()['setCode'](a0_0x1eac19)['setZone'](a0_0x4a637f)['init']();}static['setCode'](_0x803b28){return a0_0x1eac19=_0x803b28,this;}static['setZone'](_0x378394){return a0_0x4a637f=_0x378394,this;}static['seperator'](){return a0_0x4b7070(()=>new Date()['toLocaleDateString'](a0_0x1eac19)['replace'](/\d/g,'')['split']('')[0x0]);}['cpy'](){return a0_0x4b7070(()=>a0_0x342409['new']()['setTime'](this['toTime']()));}['setCode'](_0x40deb4){return this['code']=_0x40deb4,this;}['setZone'](_0x22242e){return this['_zone']=_0x22242e,this;}['seperator'](){return a0_0x4b7070(()=>new Date()['toLocaleDateString'](this['code'])['replace'](/\d/g,'')['split']('')[0x0]);}['timezone'](){return a0_0x4b7070(()=>{return this['zone']||Intl['DateTimeFormat']()?.['resolvedOptions']()?.['timeZone'];},null);}['zones'](_0x1dcd16=this['code']){return a0_0x4b7070(()=>{return new Intl['Locale'](_0x1dcd16)?.['timeZones']||[];},null);}['region'](_0x45916d=this['code']){return a0_0x4b7070(()=>{return new Intl['Locale'](_0x45916d)['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 _0x37f599=this['val']['dayOfWeek'];return _0x37f599?_0x37f599:0x7;}['dayOfWeekUtc'](){return this['val']['dayOfWeek']-0x1;}['setYear'](_0x468545){const _0x5d90ae={};return _0x5d90ae['year']=_0x468545,this['val']=this['val']['with'](_0x5d90ae),this;}['setMonth'](_0x4f6042){const _0x1940cd={};return _0x1940cd['month']=_0x4f6042,this['val']=this['val']['with'](_0x1940cd),this;}['setMonthUtc'](_0x4fbcd7){const _0x7b0f94={};return _0x7b0f94['month']=_0x4fbcd7+0x1,this['val']=this['val']['with'](_0x7b0f94),this;}['setDay'](_0x3d4d5f){const _0x23e6be={};return _0x23e6be['day']=_0x3d4d5f,this['val']=this['val']['with'](_0x23e6be),this;}['setHour'](_0x4f0e66){const _0x5810e9={};return _0x5810e9['hour']=_0x4f0e66,this['val']=this['val']['with'](_0x5810e9),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'](_0x378edb){const _0x438e20={};return _0x438e20['minute']=_0x378edb,this['val']=this['val']['with'](_0x438e20),this;}['startOfMin'](){return this['setSeconds'](0x0),this['setMilliseconds'](0x0),this;}['endOfMin'](){return this['setSeconds'](0x3b),this['setMilliseconds'](0x3e7),this;}['setSeconds'](_0x51210d){const _0x3f7422={};return _0x3f7422['second']=_0x51210d,this['val']=this['val']['with'](_0x3f7422),this;}['startOfSeconds'](){return this['setMilliseconds'](0x0),this;}['endOfSeconds'](){return this['setMilliseconds'](0x3e7),this;}['setMilliseconds'](_0x48630e){const _0x28285c={};return _0x28285c['millisecond']=_0x48630e,this['val']=this['val']['with'](_0x28285c),this;}['startOfMilliseconds'](){return this['setMilliseconds'](0x0),this;}['endOfMilliseconds'](){return this['setMilliseconds'](0x3e7),this;}['setIsoDate'](_0x779547){return this['val']=a0_0x3bb990['Temporal']['Instant']['from'](_0x779547||new Date()['toISOString']())['toZonedDateTimeISO'](this['zone']),this;}['setTime'](_0x2030aa){return this['val']=a0_0x3bb990['Temporal']['Instant']['fromEpochMilliseconds'](_0x2030aa||new Date()['getTime']())['toZonedDateTimeISO'](this['zone']),this;}['setDate'](_0x43e93c){return this['setIsoDate'](_0x43e93c?.['toISOString']()),this;}['setDateInputValue'](_0x4d2240){return this['val']=a0_0x3bb990['Temporal']['Instant']['from'](new Date(_0x4d2240?.['replace']('T','\x20'))['toISOString']())['toZonedDateTimeISO'](this['zone']),this;}['setVal'](_0x4c58e9){return a0_0x4b7070(()=>{return a0_0x342409['new']()['setTime'](a0_0xaa8d36(_0x4c58e9,this['zone']));});}['toIsoDate'](){return this['val']['toString']()['substring'](0x0,0x17)+'Z';}['toIsoDateZone'](){return this['val']['toString']()['substring'](0x0,0x1d)+'Z';}['toTime'](){return this['val']['epochMilliseconds'];}['toDate'](){return this['val'];}['toDateMounthInput'](){return this['year']()+'-'+a0_0x1ee0ad(this['month']());}['toDateInput'](){return this['year']()+'-'+a0_0x1ee0ad(this['month']())+'-'+a0_0x1ee0ad(this['day']());}['toTimeInput'](_0x1d4445=!![]){const _0x278d00=[];return _0x278d00['push'](a0_0x1ee0ad(this['hours']())),_0x278d00['push'](a0_0x1ee0ad(this['min']())),_0x1d4445&&_0x278d00['push'](a0_0x1ee0ad(this['sec']())),_0x278d00['join'](':');}['toDateTimeInput'](_0x593bea=!![]){return this['toDateInput']()+'T'+this['toTimeInput'](_0x593bea);}['strDate'](){const _0x3420db={};return _0x3420db['month']='2-digit',_0x3420db['day']='2-digit',_0x3420db['year']='numeric',this['val']['toLocaleString'](this['code'],_0x3420db);}['strTime'](){return a0_0x1ee0ad(this['hours']())+':'+a0_0x1ee0ad(this['min']())+':'+a0_0x1ee0ad(this['sec']());}['strHHmm'](){return a0_0x1ee0ad(this['hours']())+':'+a0_0x1ee0ad(this['min']());}['str'](){return this['strDate']()+'\x20'+this['strTime']();}['strLocal'](_0x5500ca){return this['val']['toLocaleString'](this['code'],_0x5500ca);}['strYears'](){return this['val']['year']['toString']();}['strMounth'](){return a0_0x1ee0ad(this['month'](),0x2);}['strDay'](){return a0_0x1ee0ad(this['day'](),0x2);}['strHour'](){return a0_0x1ee0ad(this['hours'](),0x2);}['strMin'](){return a0_0x1ee0ad(this['min'](),0x2);}['strSec'](){return a0_0x1ee0ad(this['sec'](),0x2);}['strMsec'](){return a0_0x1ee0ad(this['msec'](),0x2);}['strDayStr'](){return{'ln':()=>this['dyfrmt']['ln'](),'sh':()=>this['dyfrmt']['sh'](),'nr':()=>this['dyfrmt']['nr']()};}['addDay'](_0x4514c4){const _0x54039d={};return _0x54039d['days']=_0x4514c4,this['val']=this['val']['add'](_0x54039d),this;}['addHours'](_0x381918){const _0x191765={};return _0x191765['hours']=_0x381918,this['val']=this['val']['add'](_0x191765),this;}['addMins'](_0x552fdb){const _0x4dab43={};return _0x4dab43['minutes']=_0x552fdb,this['val']=this['val']['add'](_0x4dab43),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'](_0x174d9c){return a0_0x4b7070(()=>{return this['cpy']()['toTime']()===a0_0xaa8d36(_0x174d9c,this['zone']);});}['gt'](_0xb2d0c3){return a0_0x4b7070(()=>{return this['cpy']()['toTime']()>a0_0xaa8d36(_0xb2d0c3,this['zone']);});}['gte'](_0x572694){return a0_0x4b7070(()=>{return this['cpy']()['toTime']()>=a0_0xaa8d36(_0x572694,this['zone']);});}['lt'](_0x50e638){return a0_0x4b7070(()=>{return this['cpy']()['toTime']()<a0_0xaa8d36(_0x50e638,this['zone']);});}['lte'](_0x40cf82){return a0_0x4b7070(()=>{return this['cpy']()['toTime']()<=a0_0xaa8d36(_0x40cf82,this['zone']);});}['btw'](_0x300263,_0x4cd469){return a0_0x4b7070(()=>{const _0xe33ee7=a0_0xaa8d36(_0x300263,this['zone']),_0x3c4abc=a0_0xaa8d36(_0x4cd469,this['zone']),_0x76c55c=this['cpy']()['toTime']();return _0xe33ee7<_0x76c55c&&_0x76c55c<_0x3c4abc;});}['btweq'](_0x92fe56,_0x3f6f9b){return a0_0x4b7070(()=>{const _0x1c4cf8=a0_0xaa8d36(_0x92fe56,this['zone']),_0x2297cb=a0_0xaa8d36(_0x3f6f9b,this['zone']),_0x39c3b4=this['cpy']()['toTime']();return _0x1c4cf8<=_0x39c3b4&&_0x39c3b4<=_0x2297cb;});}['btwEqStart'](_0x1229bf,_0x281fe9){return a0_0x4b7070(()=>{const _0x382973=a0_0xaa8d36(_0x1229bf,this['zone']),_0x1fce9b=a0_0xaa8d36(_0x281fe9,this['zone']),_0x33b06b=this['cpy']()['toTime']();return _0x382973<=_0x33b06b&&_0x33b06b<_0x1fce9b;});}['btwEqEnd'](_0x262269,_0x59113e){return a0_0x4b7070(()=>{const _0x5677a9=a0_0xaa8d36(_0x262269,this['zone']),_0x53b266=a0_0xaa8d36(_0x59113e,this['zone']),_0x1939c1=this['cpy']()['toTime']();return _0x5677a9<_0x1939c1&&_0x1939c1<=_0x53b266;});}static['diffDays'](_0x31f49f,_0x22e148,_0x54e82d){return a0_0x4b7070(()=>{const _0xa87350=a0_0xaa8d36(_0x31f49f,a0_0x4a637f),_0x2b1992=a0_0xaa8d36(_0x22e148,a0_0x4a637f);return _0x54e82d?Math['abs'](_0xa87350-_0x2b1992)/0x36ee80/0x18:(_0xa87350-_0x2b1992)/0x36ee80/0x18;});}static['diffHours'](_0x3c2854,_0x29d08b,_0x173b40){return a0_0x4b7070(()=>{const _0x569d25=a0_0xaa8d36(_0x3c2854,a0_0x4a637f),_0x1b07cb=a0_0xaa8d36(_0x29d08b,a0_0x4a637f);return _0x173b40?Math['abs'](_0x569d25-_0x1b07cb)/0x36ee80:(_0x569d25-_0x1b07cb)/0x36ee80;});}static['diffMins'](_0x22bbf7,_0x2bc965,_0x3634c2){return a0_0x4b7070(()=>{const _0x5778b0=a0_0xaa8d36(_0x22bbf7,a0_0x4a637f),_0x95d728=a0_0xaa8d36(_0x2bc965,a0_0x4a637f);return _0x3634c2?Math['abs'](_0x5778b0-_0x95d728)/0x3e8/0x3c:(_0x5778b0-_0x95d728)/0x3e8/0x3c;});}static['diffSecs'](_0x20cf41,_0x38cb5b,_0x4a5448){return a0_0x4b7070(()=>{const _0x2fecd6=a0_0xaa8d36(_0x20cf41,a0_0x4a637f),_0x3b224b=a0_0xaa8d36(_0x38cb5b,a0_0x4a637f);return _0x4a5448?Math['abs'](_0x2fecd6-_0x3b224b)/0x3e8:(_0x2fecd6-_0x3b224b)/0x3e8;});}static['divideTime'](_0x28ca3e){return a0_0x4b7070(()=>a0_0x2b7828(_0x28ca3e));}}exports['MDateUtil']=a0_0x342409;const a0_0x5d6bc2={};a0_0x5d6bc2['value']='mdateutil',a0_0x5d6bc2['writable']=![],a0_0x5d6bc2['enumerable']=!![],a0_0x5d6bc2['configurable']=![],Object['defineProperty'](a0_0x342409['prototype'],'idkey',a0_0x5d6bc2);
|
|
1
|
+
'use strict';const a0_0x3a3966={};a0_0x3a3966['value']=!![],Object['defineProperty'](exports,'__esModule',a0_0x3a3966),exports['MDateUtil']=void 0x0;const a0_0x5f2445=require('@js-temporal/polyfill'),a0_0x5b1ac3=(_0x2cc8ef,_0x4d1434=0x2)=>_0x2cc8ef['toString']()['padStart'](_0x4d1434,'0');function a0_0x253b3f(_0x1f0c68,_0x3c9844){try{return _0x1f0c68();}catch(_0x8d5dd7){if(_0x3c9844)return _0x3c9844;throw new Error('UNKNOWN');}}function a0_0x19adff(_0x528c06,_0x225cc8){try{if(_0x528c06 instanceof Date)return a0_0x5f2445['Temporal']['Instant']['fromEpochMilliseconds'](_0x528c06['getTime']())['toZonedDateTimeISO'](_0x225cc8)['epochMilliseconds'];if(typeof _0x528c06==='number')return _0x528c06;if(typeof _0x528c06==='string')return a0_0x5f2445['Temporal']['Instant']['fromEpochMilliseconds'](new Date(_0x528c06)['getTime']())['toZonedDateTimeISO'](_0x225cc8)['epochMilliseconds'];if(_0x528c06 instanceof a0_0x4da09b)return _0x528c06['toTime']();if(_0x528c06['idkey']==='MDateUtil')return _0x528c06['toTime']();return 0x0;}catch(_0x2d3449){throw new Error('ERROR');}}function a0_0x516a79(_0x4b8e7){function _0x5a5b40(_0x51b922){const _0x5842f1={};return _0x5842f1['weekday']=_0x51b922,a0_0x253b3f(()=>new Intl['DateTimeFormat'](_0x4b8e7['localCode'],_0x5842f1)['format'](a0_0x19adff(_0x4b8e7,_0x4b8e7['zone'])),'');}function _0x3beb72(){return _0x5a5b40('long');}function _0x13b0b1(){return _0x5a5b40('short');}function _0x31c06b(){return _0x5a5b40('narrow');}const _0x1b1283={};return _0x1b1283['ln']=_0x3beb72,_0x1b1283['sh']=_0x13b0b1,_0x1b1283['nr']=_0x31c06b,_0x1b1283;}function a0_0x4b6b42(_0x272488){let _0x57c69b=undefined,_0x50fd55=undefined,_0x309123=undefined,_0x48fc03=undefined;try{const _0x58b818=(_0x272488||'')['match'](/\w{2}:\w{2}(:\w{2})?\b/g)[0x0]['split'](':');_0x57c69b=_0x58b818['length']>=0x1?Number(_0x58b818[0x0]):undefined,_0x50fd55=_0x58b818['length']>=0x2?Number(_0x58b818[0x1]):undefined,_0x309123=_0x58b818['length']>=0x3?Number(_0x58b818[0x2]):undefined;}catch(_0x1a2299){}try{let _0x149ca7=_0x272488||'',_0x2c8abd=/\.\d{3}/g,_0x4ed0a0=_0x149ca7['match'](_0x2c8abd)[0x0]['split']('.')['filter'](_0x4f999c=>Boolean(_0x4f999c));_0x48fc03=_0x4ed0a0['length']>=0x1?Number(_0x4ed0a0[0x0]):undefined;}catch(_0x5954f0){}const _0x347365={};return _0x347365['h']=_0x57c69b,_0x347365['m']=_0x50fd55,_0x347365['s']=_0x309123,_0x347365['ms']=_0x48fc03,_0x347365;}let a0_0x235432=Intl['NumberFormat']()['resolvedOptions']()['locale'],a0_0x547a77=Intl['DateTimeFormat']()['resolvedOptions']()['timeZone'];class a0_0x4da09b{['val'];['_code']=Intl['NumberFormat']()['resolvedOptions']()['locale'];['_zone']=Intl['DateTimeFormat']()['resolvedOptions']()['timeZone'];['dyfrmt']=a0_0x516a79(this);get['localCode'](){return this['_code'];}get['zone'](){return this['_zone'];}['with'](_0xa0a3d3){this['val']=this['val']['with']({'year':_0xa0a3d3['getFullYear'](),'month':_0xa0a3d3['getMonth']()+0x1,'day':_0xa0a3d3['getDate'](),'hour':_0xa0a3d3['getHours'](),'minute':_0xa0a3d3['getMinutes'](),'second':_0xa0a3d3['getSeconds'](),'millisecond':_0xa0a3d3['getMilliseconds']()});}['init'](){const _0x1595d6=new Date();return this['val']=a0_0x5f2445['Temporal']['Instant']['from'](_0x1595d6['toISOString']())['toZonedDateTimeISO'](this['zone']),this['dyfrmt']=a0_0x516a79(this),this;}['toString'](){return'---';}static['new'](){return new a0_0x4da09b()['setCode'](a0_0x235432)['setZone'](a0_0x547a77)['init']();}static['setCode'](_0x58b471){return a0_0x235432=_0x58b471,this;}static['setZone'](_0x431706){return a0_0x547a77=_0x431706,this;}static['seperator'](){return a0_0x253b3f(()=>new Date()['toLocaleDateString'](a0_0x235432)['replace'](/\d/g,'')['split']('')[0x0]);}['cpy'](){return a0_0x253b3f(()=>a0_0x4da09b['new']()['setTime'](this['toTime']()));}['setCode'](_0x2aa4a0){return this['_code']=_0x2aa4a0,this;}['setZone'](_0x4170fd){return this['_zone']=_0x4170fd,this;}['seperator'](){return a0_0x253b3f(()=>new Date()['toLocaleDateString'](this['_code'])['replace'](/\d/g,'')['split']('')[0x0]);}['timezone'](){return a0_0x253b3f(()=>{return this['zone']||Intl['DateTimeFormat']()?.['resolvedOptions']()?.['timeZone'];},null);}['zones'](_0x590209=this['_code']){return a0_0x253b3f(()=>{return new Intl['Locale'](_0x590209)?.['timeZones']||[];},null);}['region'](_0x511817=this['_code']){return a0_0x253b3f(()=>{return new Intl['Locale'](_0x511817)['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 _0xaeb7e7=this['val']['dayOfWeek'];return _0xaeb7e7?_0xaeb7e7:0x7;}['dayOfWeekUtc'](){return this['val']['dayOfWeek']-0x1;}['setYear'](_0x569033){const _0x52d85e={};return _0x52d85e['year']=_0x569033,this['val']=this['val']['with'](_0x52d85e),this;}['setMonth'](_0x1c7ce1){const _0x443ed4={};return _0x443ed4['month']=_0x1c7ce1,this['val']=this['val']['with'](_0x443ed4),this;}['setMonthUtc'](_0x5dd054){const _0x253bdf={};return _0x253bdf['month']=_0x5dd054+0x1,this['val']=this['val']['with'](_0x253bdf),this;}['setDay'](_0x474f5e){const _0x8bd243={};return _0x8bd243['day']=_0x474f5e,this['val']=this['val']['with'](_0x8bd243),this;}['setHour'](_0x157d39){const _0x2c797b={};return _0x2c797b['hour']=_0x157d39,this['val']=this['val']['with'](_0x2c797b),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'](_0x151402){const _0x23e426={};return _0x23e426['minute']=_0x151402,this['val']=this['val']['with'](_0x23e426),this;}['startOfMin'](){return this['setSeconds'](0x0),this['setMilliseconds'](0x0),this;}['endOfMin'](){return this['setSeconds'](0x3b),this['setMilliseconds'](0x3e7),this;}['setSeconds'](_0x1faf8d){const _0x488c9c={};return _0x488c9c['second']=_0x1faf8d,this['val']=this['val']['with'](_0x488c9c),this;}['startOfSeconds'](){return this['setMilliseconds'](0x0),this;}['endOfSeconds'](){return this['setMilliseconds'](0x3e7),this;}['setMilliseconds'](_0x1c18dd){const _0x478f5a={};return _0x478f5a['millisecond']=_0x1c18dd,this['val']=this['val']['with'](_0x478f5a),this;}['startOfMilliseconds'](){return this['setMilliseconds'](0x0),this;}['endOfMilliseconds'](){return this['setMilliseconds'](0x3e7),this;}['setIsoDate'](_0x33cbaa){const _0x2dcb0b=_0x33cbaa?new Date(_0x33cbaa?.['replace']('T','\x20')):new Date();return this['val']=a0_0x5f2445['Temporal']['Instant']['from'](_0x2dcb0b['toISOString']())['toZonedDateTimeISO'](this['zone']),this;}['setTime'](_0x4df298){return this['val']=a0_0x5f2445['Temporal']['Instant']['fromEpochMilliseconds'](_0x4df298||new Date()['getTime']())['toZonedDateTimeISO'](this['zone']),this;}['setDate'](_0x556afc){return this['setIsoDate'](_0x556afc?.['toISOString']()),this;}['setDateInputValue'](_0x46ba5a){const _0x32a500=_0x46ba5a?new Date(_0x46ba5a?.['replace']('T','\x20')):new Date();return _0x32a500['getTime']()&&(this['val']=a0_0x5f2445['Temporal']['Instant']['from'](_0x32a500?.['toISOString']())['toZonedDateTimeISO'](this['zone']),this['with'](_0x32a500)),this;}['setVal'](_0x4a1ffc){return a0_0x253b3f(()=>{return a0_0x4da09b['new']()['setTime'](a0_0x19adff(_0x4a1ffc,this['zone']));});}['toIsoDate'](){return this['val']['toInstant']()['toString']();}['toIsoDateZone'](){return this['val']['toString']()['substring'](0x0,0x1d)+'Z';}['toTime'](){return this['val']['epochMilliseconds'];}['toDate'](){return this['val'];}['toDateMounthInput'](){return this['year']()+'-'+a0_0x5b1ac3(this['month']());}['toDateInput'](){return this['year']()+'-'+a0_0x5b1ac3(this['month']())+'-'+a0_0x5b1ac3(this['day']());}['toTimeInput'](_0x4c14fc=!![]){const _0x82ce12=[];return _0x82ce12['push'](a0_0x5b1ac3(this['hours']())),_0x82ce12['push'](a0_0x5b1ac3(this['min']())),_0x4c14fc&&_0x82ce12['push'](a0_0x5b1ac3(this['sec']())),_0x82ce12['join'](':');}['toDateTimeInput'](_0x14456b=!![]){return this['toDateInput']()+'T'+this['toTimeInput'](_0x14456b);}['toAs'](){return this['val']['toInstant']()['toString']();}['strDate'](){const _0x33f96c={};return _0x33f96c['month']='2-digit',_0x33f96c['day']='2-digit',_0x33f96c['year']='numeric',this['val']['toLocaleString'](this['_code'],_0x33f96c);}['strTime'](){return a0_0x5b1ac3(this['hours']())+':'+a0_0x5b1ac3(this['min']())+':'+a0_0x5b1ac3(this['sec']());}['strHHmm'](){return a0_0x5b1ac3(this['hours']())+':'+a0_0x5b1ac3(this['min']());}['str'](){return this['strDate']()+'\x20'+this['strTime']();}['strLocal'](_0x453bc2){return this['val']['toLocaleString'](this['_code'],_0x453bc2);}['strYears'](){return this['val']['year']['toString']();}['strMounth'](){return a0_0x5b1ac3(this['month'](),0x2);}['strDay'](){return a0_0x5b1ac3(this['day'](),0x2);}['strHour'](){return a0_0x5b1ac3(this['hours'](),0x2);}['strMin'](){return a0_0x5b1ac3(this['min'](),0x2);}['strSec'](){return a0_0x5b1ac3(this['sec'](),0x2);}['strMsec'](){return a0_0x5b1ac3(this['msec'](),0x2);}['strDayStr'](){return{'ln':()=>this['dyfrmt']['ln'](),'sh':()=>this['dyfrmt']['sh'](),'nr':()=>this['dyfrmt']['nr']()};}['addDay'](_0x1a968){const _0x1dd359={};return _0x1dd359['days']=_0x1a968,this['val']=this['val']['add'](_0x1dd359),this;}['addHours'](_0x579ddc){const _0x1b330a={};return _0x1b330a['hours']=_0x579ddc,this['val']=this['val']['add'](_0x1b330a),this;}['addMins'](_0x45775c){const _0x4cea41={};return _0x4cea41['minutes']=_0x45775c,this['val']=this['val']['add'](_0x4cea41),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'](_0x5dd696){return a0_0x253b3f(()=>{return this['cpy']()['toTime']()===a0_0x19adff(_0x5dd696,this['zone']);});}['gt'](_0x491cd1){return a0_0x253b3f(()=>{return this['cpy']()['toTime']()>a0_0x19adff(_0x491cd1,this['zone']);});}['gte'](_0x172ea5){return a0_0x253b3f(()=>{return this['cpy']()['toTime']()>=a0_0x19adff(_0x172ea5,this['zone']);});}['lt'](_0x34b294){return a0_0x253b3f(()=>{return this['cpy']()['toTime']()<a0_0x19adff(_0x34b294,this['zone']);});}['lte'](_0x1ce628){return a0_0x253b3f(()=>{return this['cpy']()['toTime']()<=a0_0x19adff(_0x1ce628,this['zone']);});}['btw'](_0x38fcb8,_0xc0a955){return a0_0x253b3f(()=>{const _0x10a34a=a0_0x19adff(_0x38fcb8,this['zone']),_0x43e977=a0_0x19adff(_0xc0a955,this['zone']),_0x3c31d1=this['cpy']()['toTime']();return _0x10a34a<_0x3c31d1&&_0x3c31d1<_0x43e977;});}['btweq'](_0x28eccb,_0x59d1d0){return a0_0x253b3f(()=>{const _0x1d0a93=a0_0x19adff(_0x28eccb,this['zone']),_0x4ecb7d=a0_0x19adff(_0x59d1d0,this['zone']),_0x3a3b0c=this['cpy']()['toTime']();return _0x1d0a93<=_0x3a3b0c&&_0x3a3b0c<=_0x4ecb7d;});}['btwEqStart'](_0x1be2a9,_0x4bc7b5){return a0_0x253b3f(()=>{const _0x39cff5=a0_0x19adff(_0x1be2a9,this['zone']),_0x548e16=a0_0x19adff(_0x4bc7b5,this['zone']),_0x3eeb80=this['cpy']()['toTime']();return _0x39cff5<=_0x3eeb80&&_0x3eeb80<_0x548e16;});}['btwEqEnd'](_0x11bb5c,_0x518b9f){return a0_0x253b3f(()=>{const _0x41b4d5=a0_0x19adff(_0x11bb5c,this['zone']),_0x24af80=a0_0x19adff(_0x518b9f,this['zone']),_0x32db04=this['cpy']()['toTime']();return _0x41b4d5<_0x32db04&&_0x32db04<=_0x24af80;});}static['diffDays'](_0x33fd0c,_0x241ca2,_0x3f5eb1){return a0_0x253b3f(()=>{const _0x14f1de=a0_0x19adff(_0x33fd0c,a0_0x547a77),_0x4a6fe8=a0_0x19adff(_0x241ca2,a0_0x547a77);return _0x3f5eb1?Math['abs'](_0x14f1de-_0x4a6fe8)/0x36ee80/0x18:(_0x14f1de-_0x4a6fe8)/0x36ee80/0x18;});}static['diffHours'](_0x29e396,_0x122540,_0x4bd90f){return a0_0x253b3f(()=>{const _0x58812e=a0_0x19adff(_0x29e396,a0_0x547a77),_0xc08ccd=a0_0x19adff(_0x122540,a0_0x547a77);return _0x4bd90f?Math['abs'](_0x58812e-_0xc08ccd)/0x36ee80:(_0x58812e-_0xc08ccd)/0x36ee80;});}static['diffMins'](_0x6b9d90,_0x38fed8,_0x27d611){return a0_0x253b3f(()=>{const _0x42b9d7=a0_0x19adff(_0x6b9d90,a0_0x547a77),_0x35e253=a0_0x19adff(_0x38fed8,a0_0x547a77);return _0x27d611?Math['abs'](_0x42b9d7-_0x35e253)/0x3e8/0x3c:(_0x42b9d7-_0x35e253)/0x3e8/0x3c;});}static['diffSecs'](_0x9a5f,_0x5a95ea,_0x513b22){return a0_0x253b3f(()=>{const _0x2e0b99=a0_0x19adff(_0x9a5f,a0_0x547a77),_0x2f471f=a0_0x19adff(_0x5a95ea,a0_0x547a77);return _0x513b22?Math['abs'](_0x2e0b99-_0x2f471f)/0x3e8:(_0x2e0b99-_0x2f471f)/0x3e8;});}static['divideTime'](_0xecba3f){return a0_0x253b3f(()=>a0_0x4b6b42(_0xecba3f));}}exports['MDateUtil']=a0_0x4da09b;const a0_0x5dfefd={};a0_0x5dfefd['value']='MDateUtil',a0_0x5dfefd['writable']=![],a0_0x5dfefd['enumerable']=!![],a0_0x5dfefd['configurable']=![],Object['defineProperty'](a0_0x4da09b['prototype'],'idkey',a0_0x5dfefd);
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var a0_0x4c580d=this&&this['__createBinding']||(Object['create']?function(_0x1449a1,_0x14c1ff,_0x29b25b,_0x3183fa){if(_0x3183fa===undefined)_0x3183fa=_0x29b25b;var _0x311433=Object['getOwnPropertyDescriptor'](_0x14c1ff,_0x29b25b);if(!_0x311433||('get'in _0x311433?!_0x14c1ff['__esModule']:_0x311433['writable']||_0x311433['configurable'])){var _0x16c23b={};_0x16c23b['enumerable']=!![],_0x16c23b['get']=function(){return _0x14c1ff[_0x29b25b];},_0x311433=_0x16c23b;}Object['defineProperty'](_0x1449a1,_0x3183fa,_0x311433);}:function(_0xb018b1,_0x466e3f,_0xb8b1b,_0x198d61){if(_0x198d61===undefined)_0x198d61=_0xb8b1b;_0xb018b1[_0x198d61]=_0x466e3f[_0xb8b1b];}),a0_0x356a45=this&&this['__exportStar']||function(_0x5927bf,_0x1e6d5b){for(var _0x46d627 in _0x5927bf)if(_0x46d627!=='default'&&!Object['prototype']['hasOwnProperty']['call'](_0x1e6d5b,_0x46d627))a0_0x4c580d(_0x1e6d5b,_0x5927bf,_0x46d627);},a0_0x54fb32={};a0_0x54fb32['value']=!![],Object['defineProperty'](exports,'__esModule',a0_0x54fb32),a0_0x356a45(require('./DateUtil'),exports);
|