mat-date 1.5.59 → 1.5.81
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.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/DateUtil.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"t",{value:!0}),exports.i=void 0;const e=(value,len=2)=>value.toString().padStart(len,"0");class MDateUtil{h=new Date;static u=void 0;code=void 0;get o(){return this.code}static l(){return(new MDateUtil).v(MDateUtil.u)}static v(code){return MDateUtil.u=code,this}static D(){return(new Date).toLocaleDateString(MDateUtil.u).replace(/\d/g,"").split("")[0]}p(){return MDateUtil.l().setTime(this.M())}v(code){return this.code=code,this}D(){return(new Date).toLocaleDateString(this.code).replace(/\d/g,"").split("")[0]}year(){return this.h.getFullYear()}month(){return this.h.getMonth()+1}O(){return this.h.getMonth()}day(){return this.h.getDate()}U(){return this.h.getHours()}min(){return this.h.getMinutes()}m(){return this.h.getSeconds()}N(){var t=this.h.getDay();return t||7}S(){return this.h.getDay()}setYear(value){return this.h.setFullYear(value),this}setMonth(value){return this.h.setMonth(value-1),this}W(value){return this.h.setMonth(value),this}T(value){return this.h.setDate(value),this}g(value){return this.h.setHours(value),this}H(){return this.g(0),this.I(0),this.setSeconds(0),this.setMilliseconds(0),this}k(){return this.g(23),this.I(59),this.setSeconds(59),this.setMilliseconds(999),this}I(value){return this.h.setMinutes(value),this}B(){return this.I(0),this.setSeconds(0),this.setMilliseconds(0),this}C(){return this.I(59),this.setSeconds(59),this.setMilliseconds(999),this}setSeconds(value){return this.h.setSeconds(value),this}K(){return this.setSeconds(0),this.setMilliseconds(0),this}$(){return this.setSeconds(59),this.setMilliseconds(999),this}setMilliseconds(value){return this.h.setMilliseconds(value),this}L(){return this.setMilliseconds(0),this}R(){return this.setMilliseconds(999),this}_(value){return this.h=new Date(value),this}setTime(value){return this.h=new Date(value),this}setDate(value){return this.h=new Date(value),this}j(value){return this.h=new Date(value?.replace("T"," ")),this}V(){return this.h.toISOString()}M(){return this.h.getTime()}Y(){return this.h}q(){return this.year()+"-"+e(this.month())}A(){return`${this.year()}-${e(this.month())}-`+e(this.day())}F(byS=!0){var t=[];return t.push(e(this.U())),t.push(e(this.min())),byS&&t.push(e(this.m())),t.join(":")}G(byS=!0){return this.A()+"T"+this.F(byS)}J(){return this.h.toLocaleDateString(this.code,{month:"2-digit",day:"2-digit",year:"numeric"})}P(options){return this.h.toLocaleDateString(this.code,options)}X(){return`${e(this.U())}:${e(this.min())}:`+e(this.m())}Z(options){return this.h.toLocaleTimeString(this.code,options)}tt(){return e(this.U())+":"+e(this.min())}et(){return this.J()+" "+this.X()}rt(options){return this.h.toLocaleString(this.code,options)}st(value){return this.h=new Date(this.h.setHours(this.h.getHours()+24*value)),this}it(value){return this.h=new Date(this.h.setHours(this.h.getHours()+value)),this}ht(value){return this.h=new Date(this.h.setMinutes(this.h.getMinutes()+value)),this}nt(){return this.H(),this}ut(){return this.p().nt()}ot(){return this.k(),this}ft(){return this.p().ot()}lt(){return this.st(1-this.N())}ct(){return this.p().st(1-this.N())}dt(){return this.lt().st(6)}vt(){return this.ct().st(6)}Dt(){return this.T(1),this.nt(),this}yt(){return this.p().Dt()}bt(){return this.setDate(this.h).Dt().setMonth(this.month()+1).Dt().st(-1).ot(),this}Mt(){return this.p().bt()}static Ot(before,after,abs){try{var t=parse(before),e=parse(after);return abs?Math.abs(t-e)/36e5/24:(t-e)/36e5/24}catch(r){throw new Error("UNKNOWN")}}static wt(before,after,abs){try{var t=parse(before),e=parse(after);return abs?Math.abs(t-e)/36e5:(t-e)/36e5}catch(r){throw new Error("UNKNOWN")}}static Ut(before,after,abs){try{var t=parse(before),e=parse(after);return abs?Math.abs(t-e)/1e3/60:(t-e)/1e3/60}catch(r){throw new Error("UNKNOWN")}}static Nt(before,after,abs){try{var t=parse(before),e=parse(after);return abs?Math.abs(t-e)/1e3:(t-e)/1e3}catch(r){throw new Error("UNKNOWN")}}}function parse(before){try{return before instanceof MDateUtil?before.M():before instanceof Date?before.getTime():"number"==typeof before?before:"string"==typeof before?new Date(before).getTime():0}catch(t){throw new Error("ERROR")}}exports.i=MDateUtil;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(o,m,k,k2){void 0===k2&&(k2=k);var t=Object.getOwnPropertyDescriptor(m,k);t&&("get"in t?m.t:!t.writable&&!t.configurable)||(t={o:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,t)}:function(o,m,k,k2){o[k2=void 0===k2?k:k2]=m[k]}),t=this&&this.__exportStar||function(m,exports){for(var t in m)"default"===t||Object.prototype.hasOwnProperty.call(exports,t)||e(exports,m,t)};Object.defineProperty(exports,"t",{value:!0}),t(require("./DateUtil"),exports);
|