mat-date 1.8.90 → 1.8.94
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 +1 -2
- package/dist/DateUtil.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/DateUtil.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Temporal } from '@js-temporal/polyfill';
|
|
2
1
|
interface IStrOptions {
|
|
3
2
|
localeMatcher?: "best fit" | "lookup" | undefined;
|
|
4
3
|
weekday?: "long" | "short" | "narrow" | undefined;
|
|
@@ -69,7 +68,7 @@ export declare class MDateUtil {
|
|
|
69
68
|
toIsoDate(): string;
|
|
70
69
|
toIsoDateZone(): string;
|
|
71
70
|
toTime(): number;
|
|
72
|
-
toDate():
|
|
71
|
+
toDate(): Date;
|
|
73
72
|
toDateMounthInput(): string;
|
|
74
73
|
toDateInput(): string;
|
|
75
74
|
toTimeInput(byS?: boolean): any;
|
package/dist/DateUtil.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x3d32f3={};a0_0x3d32f3['value']=!![],Object['defineProperty'](exports,'__esModule',a0_0x3d32f3),exports['MDateUtil']=void 0x0;const a0_0x345918=require('@js-temporal/polyfill'),a0_0x3700da=(_0xc7e9c5,_0x397d7a=0x2)=>_0xc7e9c5['toString']()['padStart'](_0x397d7a,'0');function a0_0x4fd849(_0x2484e3,_0x2a64fd){try{return _0x2484e3();}catch(_0x2d8924){if(_0x2a64fd)return _0x2a64fd;throw new Error('UNKNOWN');}}function a0_0x3d150e(_0x3e95dd,_0x22072a){try{if(_0x3e95dd instanceof Date)return a0_0x345918['Temporal']['Instant']['fromEpochMilliseconds'](_0x3e95dd['getTime']())['toZonedDateTimeISO'](_0x22072a)['epochMilliseconds'];if(typeof _0x3e95dd==='number')return _0x3e95dd;if(typeof _0x3e95dd==='string')return a0_0x345918['Temporal']['Instant']['fromEpochMilliseconds'](new Date(_0x3e95dd)['getTime']())['toZonedDateTimeISO'](_0x22072a)['epochMilliseconds'];if(_0x3e95dd instanceof a0_0x472948)return _0x3e95dd['toTime']();if(_0x3e95dd['idkey']==='MDateUtil')return _0x3e95dd['toTime']();return 0x0;}catch(_0x491322){throw new Error('ERROR');}}function a0_0x493c03(_0x4f115e){function _0x1d95e5(_0x584a43){const _0x4974d4={};return _0x4974d4['weekday']=_0x584a43,a0_0x4fd849(()=>new Intl['DateTimeFormat'](_0x4f115e['localCode'],_0x4974d4)['format'](a0_0x3d150e(_0x4f115e,_0x4f115e['zone'])),'');}function _0x46ff7c(){return _0x1d95e5('long');}function _0x9e5af2(){return _0x1d95e5('short');}function _0x105532(){return _0x1d95e5('narrow');}const _0x1276ef={};return _0x1276ef['ln']=_0x46ff7c,_0x1276ef['sh']=_0x9e5af2,_0x1276ef['nr']=_0x105532,_0x1276ef;}function a0_0x1decaa(_0x48f671){let _0x542d54=undefined,_0x3f7aa5=undefined,_0x16cf3d=undefined,_0x42b71f=undefined;try{const _0x2908b8=(_0x48f671||'')['match'](/\w{2}:\w{2}(:\w{2})?\b/g)[0x0]['split'](':');_0x542d54=_0x2908b8['length']>=0x1?Number(_0x2908b8[0x0]):undefined,_0x3f7aa5=_0x2908b8['length']>=0x2?Number(_0x2908b8[0x1]):undefined,_0x16cf3d=_0x2908b8['length']>=0x3?Number(_0x2908b8[0x2]):undefined;}catch(_0x5d177e){}try{let _0x1065c8=_0x48f671||'',_0x1dfa14=/\.\d{3}/g,_0xce4368=_0x1065c8['match'](_0x1dfa14)[0x0]['split']('.')['filter'](_0x52aec5=>Boolean(_0x52aec5));_0x42b71f=_0xce4368['length']>=0x1?Number(_0xce4368[0x0]):undefined;}catch(_0x4650b9){}const _0x425350={};return _0x425350['h']=_0x542d54,_0x425350['m']=_0x3f7aa5,_0x425350['s']=_0x16cf3d,_0x425350['ms']=_0x42b71f,_0x425350;}let a0_0x2d5c56=Intl['NumberFormat']()['resolvedOptions']()['locale'],a0_0x4ef52e=Intl['DateTimeFormat']()['resolvedOptions']()['timeZone'];class a0_0x472948{['val'];['_code']=Intl['NumberFormat']()['resolvedOptions']()['locale'];['_zone']=Intl['DateTimeFormat']()['resolvedOptions']()['timeZone'];['dyfrmt']=a0_0x493c03(this);get['localCode'](){return this['_code'];}get['zone'](){return this['_zone'];}['with'](_0x3c46aa){this['val']=this['val']['with']({'year':_0x3c46aa['getFullYear'](),'month':_0x3c46aa['getMonth']()+0x1,'day':_0x3c46aa['getDate'](),'hour':_0x3c46aa['getHours'](),'minute':_0x3c46aa['getMinutes'](),'second':_0x3c46aa['getSeconds'](),'millisecond':_0x3c46aa['getMilliseconds']()});}['init'](){const _0x4eafe8=new Date();return this['val']=a0_0x345918['Temporal']['Instant']['from'](_0x4eafe8['toISOString']())['toZonedDateTimeISO'](this['zone']),this['dyfrmt']=a0_0x493c03(this),this;}['toString'](){return'---';}static['new'](){return new a0_0x472948()['setCode'](a0_0x2d5c56)['setZone'](a0_0x4ef52e)['init']();}static['setCode'](_0x5e32e1){return a0_0x2d5c56=_0x5e32e1,this;}static['setZone'](_0x1ab9aa){return a0_0x4ef52e=_0x1ab9aa,this;}static['seperator'](){return a0_0x4fd849(()=>new Date()['toLocaleDateString'](a0_0x2d5c56)['replace'](/\d/g,'')['split']('')[0x0]);}['cpy'](){return a0_0x4fd849(()=>a0_0x472948['new']()['setTime'](this['toTime']()));}['setCode'](_0x56c738){return this['_code']=_0x56c738,this;}['setZone'](_0x19e589){return this['_zone']=_0x19e589,this;}['seperator'](){return a0_0x4fd849(()=>new Date()['toLocaleDateString'](this['_code'])['replace'](/\d/g,'')['split']('')[0x0]);}['timezone'](){return a0_0x4fd849(()=>{return this['zone']||Intl['DateTimeFormat']()?.['resolvedOptions']()?.['timeZone'];},null);}['zones'](_0x554f39=this['_code']){return a0_0x4fd849(()=>{return new Intl['Locale'](_0x554f39)?.['timeZones']||[];},null);}['region'](_0x133ab2=this['_code']){return a0_0x4fd849(()=>{return new Intl['Locale'](_0x133ab2)['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 _0x25daef=this['val']['dayOfWeek'];return _0x25daef?_0x25daef:0x7;}['dayOfWeekUtc'](){return this['val']['dayOfWeek']-0x1;}['setYear'](_0xa3787){const _0x4f83a5={};return _0x4f83a5['year']=_0xa3787,this['val']=this['val']['with'](_0x4f83a5),this;}['setMonth'](_0x4b3d19){const _0xcef71e={};return _0xcef71e['month']=_0x4b3d19,this['val']=this['val']['with'](_0xcef71e),this;}['setMonthUtc'](_0x2b0a63){const _0x225c53={};return _0x225c53['month']=_0x2b0a63+0x1,this['val']=this['val']['with'](_0x225c53),this;}['setDay'](_0x51ba7e){const _0x4f314e={};return _0x4f314e['day']=_0x51ba7e,this['val']=this['val']['with'](_0x4f314e),this;}['setHour'](_0x461d74){const _0x1cd88c={};return _0x1cd88c['hour']=_0x461d74,this['val']=this['val']['with'](_0x1cd88c),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'](_0x59acb1){const _0x35cf5b={};return _0x35cf5b['minute']=_0x59acb1,this['val']=this['val']['with'](_0x35cf5b),this;}['startOfMin'](){return this['setSeconds'](0x0),this['setMilliseconds'](0x0),this;}['endOfMin'](){return this['setSeconds'](0x3b),this['setMilliseconds'](0x3e7),this;}['setSeconds'](_0x58ad9e){const _0x23c2d1={};return _0x23c2d1['second']=_0x58ad9e,this['val']=this['val']['with'](_0x23c2d1),this;}['startOfSeconds'](){return this['setMilliseconds'](0x0),this;}['endOfSeconds'](){return this['setMilliseconds'](0x3e7),this;}['setMilliseconds'](_0xfa18a3){const _0x154092={};return _0x154092['millisecond']=_0xfa18a3,this['val']=this['val']['with'](_0x154092),this;}['startOfMilliseconds'](){return this['setMilliseconds'](0x0),this;}['endOfMilliseconds'](){return this['setMilliseconds'](0x3e7),this;}['setIsoDate'](_0x7541c7){const _0x186a80=_0x7541c7?new Date(_0x7541c7?.['replace']('T','\x20')):new Date();return this['val']=a0_0x345918['Temporal']['Instant']['from'](_0x186a80['toISOString']())['toZonedDateTimeISO'](this['zone']),this;}['setTime'](_0x326b7d){return this['val']=a0_0x345918['Temporal']['Instant']['fromEpochMilliseconds'](_0x326b7d||new Date()['getTime']())['toZonedDateTimeISO'](this['zone']),this;}['setDate'](_0x5ba194){return this['setIsoDate'](_0x5ba194?.['toISOString']()),this;}['setDateInputValue'](_0x5f1065){const _0x44e5d3=_0x5f1065?new Date(_0x5f1065?.['replace']('T','\x20')):new Date();return _0x44e5d3['getTime']()&&(this['val']=a0_0x345918['Temporal']['Instant']['from'](_0x44e5d3?.['toISOString']())['toZonedDateTimeISO'](this['zone']),this['with'](_0x44e5d3)),this;}['setVal'](_0x539f29){return a0_0x4fd849(()=>{return a0_0x472948['new']()['setTime'](a0_0x3d150e(_0x539f29,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_0x3700da(this['month']());}['toDateInput'](){return this['year']()+'-'+a0_0x3700da(this['month']())+'-'+a0_0x3700da(this['day']());}['toTimeInput'](_0x19b273=!![]){const _0xdf4832=[];return _0xdf4832['push'](a0_0x3700da(this['hours']())),_0xdf4832['push'](a0_0x3700da(this['min']())),_0x19b273&&_0xdf4832['push'](a0_0x3700da(this['sec']())),_0xdf4832['join'](':');}['toDateTimeInput'](_0xdc06b1=!![]){return this['toDateInput']()+'T'+this['toTimeInput'](_0xdc06b1);}['toAs'](){return this['val']['toInstant']()['toString']();}['strDate'](){const _0x4befe4={};return _0x4befe4['month']='2-digit',_0x4befe4['day']='2-digit',_0x4befe4['year']='numeric',this['val']['toLocaleString'](this['_code'],_0x4befe4);}['strTime'](){return a0_0x3700da(this['hours']())+':'+a0_0x3700da(this['min']())+':'+a0_0x3700da(this['sec']());}['strHHmm'](){return a0_0x3700da(this['hours']())+':'+a0_0x3700da(this['min']());}['str'](){return this['strDate']()+'\x20'+this['strTime']();}['strLocal'](_0x57e941){return this['val']['toLocaleString'](this['_code'],_0x57e941);}['strYears'](){return this['val']['year']['toString']();}['strMounth'](){return a0_0x3700da(this['month'](),0x2);}['strDay'](){return a0_0x3700da(this['day'](),0x2);}['strHour'](){return a0_0x3700da(this['hours'](),0x2);}['strMin'](){return a0_0x3700da(this['min'](),0x2);}['strSec'](){return a0_0x3700da(this['sec'](),0x2);}['strMsec'](){return a0_0x3700da(this['msec'](),0x2);}['strDayStr'](){return{'ln':()=>this['dyfrmt']['ln'](),'sh':()=>this['dyfrmt']['sh'](),'nr':()=>this['dyfrmt']['nr']()};}['addDay'](_0x398c7c){const _0x37812c={};return _0x37812c['days']=_0x398c7c,this['val']=this['val']['add'](_0x37812c),this;}['addHours'](_0x944f00){const _0xdee349={};return _0xdee349['hours']=_0x944f00,this['val']=this['val']['add'](_0xdee349),this;}['addMins'](_0x42f363){const _0x665a7c={};return _0x665a7c['minutes']=_0x42f363,this['val']=this['val']['add'](_0x665a7c),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'](_0x87cd76){return a0_0x4fd849(()=>{return this['cpy']()['toTime']()===a0_0x3d150e(_0x87cd76,this['zone']);});}['gt'](_0x1dc5de){return a0_0x4fd849(()=>{return this['cpy']()['toTime']()>a0_0x3d150e(_0x1dc5de,this['zone']);});}['gte'](_0x394ff0){return a0_0x4fd849(()=>{return this['cpy']()['toTime']()>=a0_0x3d150e(_0x394ff0,this['zone']);});}['lt'](_0x1a07a7){return a0_0x4fd849(()=>{return this['cpy']()['toTime']()<a0_0x3d150e(_0x1a07a7,this['zone']);});}['lte'](_0x516bd6){return a0_0x4fd849(()=>{return this['cpy']()['toTime']()<=a0_0x3d150e(_0x516bd6,this['zone']);});}['btw'](_0x3349e1,_0x2ccc82){return a0_0x4fd849(()=>{const _0xbcef6c=a0_0x3d150e(_0x3349e1,this['zone']),_0x1323f2=a0_0x3d150e(_0x2ccc82,this['zone']),_0x209d48=this['cpy']()['toTime']();return _0xbcef6c<_0x209d48&&_0x209d48<_0x1323f2;});}['btweq'](_0x27a0b6,_0x3fc430){return a0_0x4fd849(()=>{const _0x18112a=a0_0x3d150e(_0x27a0b6,this['zone']),_0x3393d2=a0_0x3d150e(_0x3fc430,this['zone']),_0x28dfd0=this['cpy']()['toTime']();return _0x18112a<=_0x28dfd0&&_0x28dfd0<=_0x3393d2;});}['btwEqStart'](_0xdc0a48,_0x36655e){return a0_0x4fd849(()=>{const _0x4c8566=a0_0x3d150e(_0xdc0a48,this['zone']),_0x11c0af=a0_0x3d150e(_0x36655e,this['zone']),_0x528bf6=this['cpy']()['toTime']();return _0x4c8566<=_0x528bf6&&_0x528bf6<_0x11c0af;});}['btwEqEnd'](_0x580e9c,_0x5eef4e){return a0_0x4fd849(()=>{const _0x1322cb=a0_0x3d150e(_0x580e9c,this['zone']),_0x9faaed=a0_0x3d150e(_0x5eef4e,this['zone']),_0x10d8aa=this['cpy']()['toTime']();return _0x1322cb<_0x10d8aa&&_0x10d8aa<=_0x9faaed;});}static['diffDays'](_0x216897,_0x234363,_0x184f70){return a0_0x4fd849(()=>{const _0x26daf7=a0_0x3d150e(_0x216897,a0_0x4ef52e),_0x485bcd=a0_0x3d150e(_0x234363,a0_0x4ef52e);return _0x184f70?Math['abs'](_0x26daf7-_0x485bcd)/0x36ee80/0x18:(_0x26daf7-_0x485bcd)/0x36ee80/0x18;});}static['diffHours'](_0x3d8eed,_0xbb9650,_0x28b3ea){return a0_0x4fd849(()=>{const _0x30e763=a0_0x3d150e(_0x3d8eed,a0_0x4ef52e),_0x161f91=a0_0x3d150e(_0xbb9650,a0_0x4ef52e);return _0x28b3ea?Math['abs'](_0x30e763-_0x161f91)/0x36ee80:(_0x30e763-_0x161f91)/0x36ee80;});}static['diffMins'](_0x3d12bc,_0x17a4d2,_0x475855){return a0_0x4fd849(()=>{const _0x1a86ee=a0_0x3d150e(_0x3d12bc,a0_0x4ef52e),_0x218bfa=a0_0x3d150e(_0x17a4d2,a0_0x4ef52e);return _0x475855?Math['abs'](_0x1a86ee-_0x218bfa)/0x3e8/0x3c:(_0x1a86ee-_0x218bfa)/0x3e8/0x3c;});}static['diffSecs'](_0x37d715,_0x50a834,_0x2b36aa){return a0_0x4fd849(()=>{const _0x57c5ac=a0_0x3d150e(_0x37d715,a0_0x4ef52e),_0x2c58be=a0_0x3d150e(_0x50a834,a0_0x4ef52e);return _0x2b36aa?Math['abs'](_0x57c5ac-_0x2c58be)/0x3e8:(_0x57c5ac-_0x2c58be)/0x3e8;});}static['divideTime'](_0x428b38){return a0_0x4fd849(()=>a0_0x1decaa(_0x428b38));}}exports['MDateUtil']=a0_0x472948;const a0_0x1e4f34={};a0_0x1e4f34['value']='MDateUtil',a0_0x1e4f34['writable']=![],a0_0x1e4f34['enumerable']=!![],a0_0x1e4f34['configurable']=![],Object['defineProperty'](a0_0x472948['prototype'],'idkey',a0_0x1e4f34);
|
|
1
|
+
'use strict';const a0_0x508cde={};a0_0x508cde['value']=!![],Object['defineProperty'](exports,'__esModule',a0_0x508cde),exports['MDateUtil']=void 0x0;const a0_0x1b1e6c=require('@js-temporal/polyfill'),a0_0x4faeef=(_0x54e637,_0x13b647=0x2)=>_0x54e637['toString']()['padStart'](_0x13b647,'0');function a0_0x1eb0a2(_0xe8f087,_0x29cdba){try{return _0xe8f087();}catch(_0x371246){if(_0x29cdba)return _0x29cdba;throw new Error('UNKNOWN');}}function a0_0x353799(_0x538200,_0x11bd0c){try{if(_0x538200 instanceof Date)return a0_0x1b1e6c['Temporal']['Instant']['fromEpochMilliseconds'](_0x538200['getTime']())['toZonedDateTimeISO'](_0x11bd0c)['epochMilliseconds'];if(typeof _0x538200==='number')return _0x538200;if(typeof _0x538200==='string')return a0_0x1b1e6c['Temporal']['Instant']['fromEpochMilliseconds'](new Date(_0x538200)['getTime']())['toZonedDateTimeISO'](_0x11bd0c)['epochMilliseconds'];if(_0x538200 instanceof a0_0x3125ec)return _0x538200['toTime']();if(_0x538200['idkey']==='MDateUtil')return _0x538200['toTime']();return 0x0;}catch(_0x451287){throw new Error('ERROR');}}function a0_0x15ce5e(_0x574fe8){function _0x36f34b(_0x5862d0){const _0x1902fa={};return _0x1902fa['weekday']=_0x5862d0,a0_0x1eb0a2(()=>new Intl['DateTimeFormat'](_0x574fe8['localCode'],_0x1902fa)['format'](a0_0x353799(_0x574fe8,_0x574fe8['zone'])),'');}function _0x5f16a1(){return _0x36f34b('long');}function _0x585454(){return _0x36f34b('short');}function _0x330885(){return _0x36f34b('narrow');}const _0x85559d={};return _0x85559d['ln']=_0x5f16a1,_0x85559d['sh']=_0x585454,_0x85559d['nr']=_0x330885,_0x85559d;}function a0_0x391ce8(_0x549595){let _0x576184=undefined,_0x5b3a5f=undefined,_0x1c741e=undefined,_0x28a6ab=undefined;try{const _0x23fab9=(_0x549595||'')['match'](/\w{2}:\w{2}(:\w{2})?\b/g)[0x0]['split'](':');_0x576184=_0x23fab9['length']>=0x1?Number(_0x23fab9[0x0]):undefined,_0x5b3a5f=_0x23fab9['length']>=0x2?Number(_0x23fab9[0x1]):undefined,_0x1c741e=_0x23fab9['length']>=0x3?Number(_0x23fab9[0x2]):undefined;}catch(_0x56f7bc){}try{let _0x195f52=_0x549595||'',_0x441c11=/\.\d{3}/g,_0x2371ce=_0x195f52['match'](_0x441c11)[0x0]['split']('.')['filter'](_0x21722e=>Boolean(_0x21722e));_0x28a6ab=_0x2371ce['length']>=0x1?Number(_0x2371ce[0x0]):undefined;}catch(_0x8c8c2a){}const _0xf27c30={};return _0xf27c30['h']=_0x576184,_0xf27c30['m']=_0x5b3a5f,_0xf27c30['s']=_0x1c741e,_0xf27c30['ms']=_0x28a6ab,_0xf27c30;}let a0_0x2230e1=Intl['NumberFormat']()['resolvedOptions']()['locale'],a0_0x9593f2=Intl['DateTimeFormat']()['resolvedOptions']()['timeZone'];class a0_0x3125ec{['val'];['_code']=Intl['NumberFormat']()['resolvedOptions']()['locale'];['_zone']=Intl['DateTimeFormat']()['resolvedOptions']()['timeZone'];['dyfrmt']=a0_0x15ce5e(this);get['localCode'](){return this['_code'];}get['zone'](){return this['_zone'];}['with'](_0x3c2cb8){this['val']=this['val']['with']({'year':_0x3c2cb8['getFullYear'](),'month':_0x3c2cb8['getMonth']()+0x1,'day':_0x3c2cb8['getDate'](),'hour':_0x3c2cb8['getHours'](),'minute':_0x3c2cb8['getMinutes'](),'second':_0x3c2cb8['getSeconds'](),'millisecond':_0x3c2cb8['getMilliseconds']()});}['init'](){const _0x37d80e=new Date();return this['val']=a0_0x1b1e6c['Temporal']['Instant']['from'](_0x37d80e['toISOString']())['toZonedDateTimeISO'](this['zone']),this['dyfrmt']=a0_0x15ce5e(this),this;}['toString'](){return'---';}static['new'](){return new a0_0x3125ec()['setCode'](a0_0x2230e1)['setZone'](a0_0x9593f2)['init']();}static['setCode'](_0x560628){return a0_0x2230e1=_0x560628,this;}static['setZone'](_0xa37d57){return a0_0x9593f2=_0xa37d57,this;}static['seperator'](){return a0_0x1eb0a2(()=>new Date()['toLocaleDateString'](a0_0x2230e1)['replace'](/\d/g,'')['split']('')[0x0]);}['cpy'](){return a0_0x1eb0a2(()=>a0_0x3125ec['new']()['setTime'](this['toTime']()));}['setCode'](_0xd878f4){return this['_code']=_0xd878f4,this;}['setZone'](_0x3d782){return this['_zone']=_0x3d782,this;}['seperator'](){return a0_0x1eb0a2(()=>new Date()['toLocaleDateString'](this['_code'])['replace'](/\d/g,'')['split']('')[0x0]);}['timezone'](){return a0_0x1eb0a2(()=>{return this['zone']||Intl['DateTimeFormat']()?.['resolvedOptions']()?.['timeZone'];},null);}['zones'](_0x125c3c=this['_code']){return a0_0x1eb0a2(()=>{return new Intl['Locale'](_0x125c3c)?.['timeZones']||[];},null);}['region'](_0x394637=this['_code']){return a0_0x1eb0a2(()=>{return new Intl['Locale'](_0x394637)['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 _0x2a916f=this['val']['dayOfWeek'];return _0x2a916f?_0x2a916f:0x7;}['dayOfWeekUtc'](){return this['val']['dayOfWeek']-0x1;}['setYear'](_0x7e693e){const _0x33f938={};return _0x33f938['year']=_0x7e693e,this['val']=this['val']['with'](_0x33f938),this;}['setMonth'](_0x1f39f4){const _0x4d1a80={};return _0x4d1a80['month']=_0x1f39f4,this['val']=this['val']['with'](_0x4d1a80),this;}['setMonthUtc'](_0x111a70){const _0x6f342={};return _0x6f342['month']=_0x111a70+0x1,this['val']=this['val']['with'](_0x6f342),this;}['setDay'](_0x22e1d9){const _0x1a3a28={};return _0x1a3a28['day']=_0x22e1d9,this['val']=this['val']['with'](_0x1a3a28),this;}['setHour'](_0x3c71ad){const _0x18ee25={};return _0x18ee25['hour']=_0x3c71ad,this['val']=this['val']['with'](_0x18ee25),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'](_0x3811b4){const _0x2ee8fb={};return _0x2ee8fb['minute']=_0x3811b4,this['val']=this['val']['with'](_0x2ee8fb),this;}['startOfMin'](){return this['setSeconds'](0x0),this['setMilliseconds'](0x0),this;}['endOfMin'](){return this['setSeconds'](0x3b),this['setMilliseconds'](0x3e7),this;}['setSeconds'](_0x6aa35d){const _0x3fa7a1={};return _0x3fa7a1['second']=_0x6aa35d,this['val']=this['val']['with'](_0x3fa7a1),this;}['startOfSeconds'](){return this['setMilliseconds'](0x0),this;}['endOfSeconds'](){return this['setMilliseconds'](0x3e7),this;}['setMilliseconds'](_0x446674){const _0x5e6c37={};return _0x5e6c37['millisecond']=_0x446674,this['val']=this['val']['with'](_0x5e6c37),this;}['startOfMilliseconds'](){return this['setMilliseconds'](0x0),this;}['endOfMilliseconds'](){return this['setMilliseconds'](0x3e7),this;}['setIsoDate'](_0x2bf306){const _0x4c8e92=_0x2bf306?new Date(_0x2bf306?.['replace']('T','\x20')):new Date();return this['val']=a0_0x1b1e6c['Temporal']['Instant']['from'](_0x4c8e92['toISOString']())['toZonedDateTimeISO'](this['zone']),this;}['setTime'](_0x2ead01){return this['val']=a0_0x1b1e6c['Temporal']['Instant']['fromEpochMilliseconds'](_0x2ead01||new Date()['getTime']())['toZonedDateTimeISO'](this['zone']),this;}['setDate'](_0x1e1be6){return this['setIsoDate'](_0x1e1be6?.['toISOString']()),this;}['setDateInputValue'](_0x58934f){const _0x27b67d=_0x58934f?new Date(_0x58934f?.['replace']('T','\x20')):new Date();return _0x27b67d['getTime']()&&(this['val']=a0_0x1b1e6c['Temporal']['Instant']['from'](_0x27b67d?.['toISOString']())['toZonedDateTimeISO'](this['zone']),this['with'](_0x27b67d)),this;}['setVal'](_0x33e0da){return a0_0x1eb0a2(()=>{return a0_0x3125ec['new']()['setTime'](a0_0x353799(_0x33e0da,this['zone']));});}['toIsoDate'](){const _0x4c7645={};return _0x4c7645['fractionalSecondDigits']=0x3,this['val']['toInstant']()['toString'](_0x4c7645);}['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_0x4faeef(this['month']());}['toDateInput'](){return this['year']()+'-'+a0_0x4faeef(this['month']())+'-'+a0_0x4faeef(this['day']());}['toTimeInput'](_0x3ba0de=!![]){const _0x22016b=[];return _0x22016b['push'](a0_0x4faeef(this['hours']())),_0x22016b['push'](a0_0x4faeef(this['min']())),_0x3ba0de&&_0x22016b['push'](a0_0x4faeef(this['sec']())),_0x22016b['join'](':');}['toDateTimeInput'](_0x405d9b=!![]){return this['toDateInput']()+'T'+this['toTimeInput'](_0x405d9b);}['toAs'](){return this['val']['toInstant']()['toString']();}['strDate'](){const _0x3f6549={};return _0x3f6549['month']='2-digit',_0x3f6549['day']='2-digit',_0x3f6549['year']='numeric',this['val']['toLocaleString'](this['_code'],_0x3f6549);}['strTime'](){return a0_0x4faeef(this['hours']())+':'+a0_0x4faeef(this['min']())+':'+a0_0x4faeef(this['sec']());}['strHHmm'](){return a0_0x4faeef(this['hours']())+':'+a0_0x4faeef(this['min']());}['str'](){return this['strDate']()+'\x20'+this['strTime']();}['strLocal'](_0x52ded9){return this['val']['toLocaleString'](this['_code'],_0x52ded9);}['strYears'](){return this['val']['year']['toString']();}['strMounth'](){return a0_0x4faeef(this['month'](),0x2);}['strDay'](){return a0_0x4faeef(this['day'](),0x2);}['strHour'](){return a0_0x4faeef(this['hours'](),0x2);}['strMin'](){return a0_0x4faeef(this['min'](),0x2);}['strSec'](){return a0_0x4faeef(this['sec'](),0x2);}['strMsec'](){return a0_0x4faeef(this['msec'](),0x2);}['strDayStr'](){return{'ln':()=>this['dyfrmt']['ln'](),'sh':()=>this['dyfrmt']['sh'](),'nr':()=>this['dyfrmt']['nr']()};}['addDay'](_0x1f2b73){const _0x955cf7={};return _0x955cf7['days']=_0x1f2b73,this['val']=this['val']['add'](_0x955cf7),this;}['addHours'](_0x1ee325){const _0x409ad7={};return _0x409ad7['hours']=_0x1ee325,this['val']=this['val']['add'](_0x409ad7),this;}['addMins'](_0x536e33){const _0x50208d={};return _0x50208d['minutes']=_0x536e33,this['val']=this['val']['add'](_0x50208d),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'](_0x18c92d){return a0_0x1eb0a2(()=>{return this['cpy']()['toTime']()===a0_0x353799(_0x18c92d,this['zone']);});}['gt'](_0x160132){return a0_0x1eb0a2(()=>{return this['cpy']()['toTime']()>a0_0x353799(_0x160132,this['zone']);});}['gte'](_0x696fc1){return a0_0x1eb0a2(()=>{return this['cpy']()['toTime']()>=a0_0x353799(_0x696fc1,this['zone']);});}['lt'](_0x5b116e){return a0_0x1eb0a2(()=>{return this['cpy']()['toTime']()<a0_0x353799(_0x5b116e,this['zone']);});}['lte'](_0x269642){return a0_0x1eb0a2(()=>{return this['cpy']()['toTime']()<=a0_0x353799(_0x269642,this['zone']);});}['btw'](_0x213dde,_0x5d836a){return a0_0x1eb0a2(()=>{const _0x4774b5=a0_0x353799(_0x213dde,this['zone']),_0x1c50ca=a0_0x353799(_0x5d836a,this['zone']),_0x489bad=this['cpy']()['toTime']();return _0x4774b5<_0x489bad&&_0x489bad<_0x1c50ca;});}['btweq'](_0x578764,_0x584c10){return a0_0x1eb0a2(()=>{const _0x4b6d3c=a0_0x353799(_0x578764,this['zone']),_0x50a06d=a0_0x353799(_0x584c10,this['zone']),_0x300809=this['cpy']()['toTime']();return _0x4b6d3c<=_0x300809&&_0x300809<=_0x50a06d;});}['btwEqStart'](_0x286251,_0x23b449){return a0_0x1eb0a2(()=>{const _0x5b6ee1=a0_0x353799(_0x286251,this['zone']),_0x4d8bd6=a0_0x353799(_0x23b449,this['zone']),_0x14ce1c=this['cpy']()['toTime']();return _0x5b6ee1<=_0x14ce1c&&_0x14ce1c<_0x4d8bd6;});}['btwEqEnd'](_0x540f2e,_0x55645f){return a0_0x1eb0a2(()=>{const _0x147e2e=a0_0x353799(_0x540f2e,this['zone']),_0x586a56=a0_0x353799(_0x55645f,this['zone']),_0x5d332e=this['cpy']()['toTime']();return _0x147e2e<_0x5d332e&&_0x5d332e<=_0x586a56;});}static['diffDays'](_0x3d2095,_0xe45e90,_0xe3d8aa){return a0_0x1eb0a2(()=>{const _0x313cc6=a0_0x353799(_0x3d2095,a0_0x9593f2),_0x2e6186=a0_0x353799(_0xe45e90,a0_0x9593f2);return _0xe3d8aa?Math['abs'](_0x313cc6-_0x2e6186)/0x36ee80/0x18:(_0x313cc6-_0x2e6186)/0x36ee80/0x18;});}static['diffHours'](_0x51ada6,_0x40d2c8,_0x48bade){return a0_0x1eb0a2(()=>{const _0x3374f3=a0_0x353799(_0x51ada6,a0_0x9593f2),_0x209278=a0_0x353799(_0x40d2c8,a0_0x9593f2);return _0x48bade?Math['abs'](_0x3374f3-_0x209278)/0x36ee80:(_0x3374f3-_0x209278)/0x36ee80;});}static['diffMins'](_0x51c249,_0x10e2f7,_0x12d367){return a0_0x1eb0a2(()=>{const _0x1cfa40=a0_0x353799(_0x51c249,a0_0x9593f2),_0x2f681f=a0_0x353799(_0x10e2f7,a0_0x9593f2);return _0x12d367?Math['abs'](_0x1cfa40-_0x2f681f)/0x3e8/0x3c:(_0x1cfa40-_0x2f681f)/0x3e8/0x3c;});}static['diffSecs'](_0x21a988,_0x56d55a,_0x1e09db){return a0_0x1eb0a2(()=>{const _0x11ae50=a0_0x353799(_0x21a988,a0_0x9593f2),_0x1e44d8=a0_0x353799(_0x56d55a,a0_0x9593f2);return _0x1e09db?Math['abs'](_0x11ae50-_0x1e44d8)/0x3e8:(_0x11ae50-_0x1e44d8)/0x3e8;});}static['divideTime'](_0x17f320){return a0_0x1eb0a2(()=>a0_0x391ce8(_0x17f320));}}exports['MDateUtil']=a0_0x3125ec;const a0_0x52aca7={};a0_0x52aca7['value']='MDateUtil',a0_0x52aca7['writable']=![],a0_0x52aca7['enumerable']=!![],a0_0x52aca7['configurable']=![],Object['defineProperty'](a0_0x3125ec['prototype'],'idkey',a0_0x52aca7);
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var a0_0x6a2114=this&&this['__createBinding']||(Object['create']?function(_0x440ed5,_0x46c25c,_0x1d9ca6,_0x804277){if(_0x804277===undefined)_0x804277=_0x1d9ca6;var _0x5a80a6=Object['getOwnPropertyDescriptor'](_0x46c25c,_0x1d9ca6);if(!_0x5a80a6||('get'in _0x5a80a6?!_0x46c25c['__esModule']:_0x5a80a6['writable']||_0x5a80a6['configurable'])){var _0x230abc={};_0x230abc['enumerable']=!![],_0x230abc['get']=function(){return _0x46c25c[_0x1d9ca6];},_0x5a80a6=_0x230abc;}Object['defineProperty'](_0x440ed5,_0x804277,_0x5a80a6);}:function(_0x3c1824,_0x10a4d2,_0x1d77e5,_0x5de713){if(_0x5de713===undefined)_0x5de713=_0x1d77e5;_0x3c1824[_0x5de713]=_0x10a4d2[_0x1d77e5];}),a0_0x5ad42a=this&&this['__exportStar']||function(_0x37fb2c,_0x2b739c){for(var _0x3be9e1 in _0x37fb2c)if(_0x3be9e1!=='default'&&!Object['prototype']['hasOwnProperty']['call'](_0x2b739c,_0x3be9e1))a0_0x6a2114(_0x2b739c,_0x37fb2c,_0x3be9e1);},a0_0x1b38fb={};a0_0x1b38fb['value']=!![],Object['defineProperty'](exports,'__esModule',a0_0x1b38fb),a0_0x5ad42a(require('./DateUtil'),exports);
|