-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathxsduration-0.0.2.min.js
More file actions
1 lines (1 loc) · 1.44 KB
/
Copy pathxsduration-0.0.2.min.js
File metadata and controls
1 lines (1 loc) · 1.44 KB
1
!function(t){"use strict";function n(t){return t%4===0&&t%100!==0||t%400===0}function e(t,e){return(n(t)?Y:f)[e-1]}function r(t,n){var r,i,u,o={};for(i=t.M+n.M,o.M=g(i,1,13),r=c(i,1,13),o.Y=t.Y+n.Y+r,i=t.S+n.S,o.S=g(i,60),r=c(i,60),i=t.m+n.m+r,o.m=g(i,60),r=c(i,60),i=t.H+n.H+r,o.H=g(i,24),r=c(i,24),u=t.D>e(o.Y,o.M)?e(o.Y,o.M):t.D<1?1:t.D,o.D=u+n.D+r;;){if(o.D<1)o.D=o.D+e(o.D,o.M-1),r=-1;else{if(!(o.D>e(o.Y,o.M)))break;o.D=o.D-e(o.Y,o.M),r=1}i=o.M+r,o.M=g(i,1,13),o.Y=o.Y+c(i,1,13)}return o.Y=0|o.Y,o.M=o.M-1|0,o.D=0|o.D,o.H=0|o.H,o.m=0|o.m,o.S=0|o.S,new Date(o.Y,o.M,o.D,o.H,o.m,o.S)}function i(t){var n=t.match(u),e="-"===n[1],r=function(t){return t&&e?-1*t:t};this.Y=0|r(n[o]),this.M=0|r(n[M]),this.D=0|r(n[s]),this.H=0|r(n[D]),this.m=0|r(n[d]),this.S=0|r(n[a])}var u=/(-?)P((\d{1,4})Y)?((\d{1,4})M)?((\d{1,4})D)?(T((\d{1,4})H)?((\d{1,4})M)?((\d{1,4}(\.\d{1,3})?)S)?)?/,o=3,M=5,s=7,D=10,d=12,a=14,f=[31,28,31,30,31,30,31,31,30,31,30,31],Y=[31,29,31,30,31,30,31,31,30,31,30,31],c=t.fQuotient=function(){var t=arguments;return 2===t.length?Math.floor(t[0]/t[1]):3===t.length?c(t[0]-t[1],t[2]-t[1]):void 0},g=t.modulo=function h(){var t=arguments;return 2===t.length?t[0]-c(t[0],t[1])*t[1]:3===t.length?h(t[0]-t[1],t[2]-t[1])+t[1]:void 0};t.add=function(t,n){var e=new i(t),u={Y:n.getFullYear(),M:n.getMonth()+1,D:n.getDate(),H:n.getHours(),m:n.getMinutes(),S:n.getSeconds()+n.getMilliseconds()/1e3};return r(u,e)}}("undefined"==typeof exports?xsdurationjs={}:exports);