timetable-fns
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -1,1 +0,1 @@ | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("moment-timezone")):"function"==typeof define&&define.amd?define(["moment-timezone"],n):"object"==typeof exports?exports["timetable-fns"]=n(require("moment-timezone")):t["timetable-fns"]=n(t.moment)}(window,function(t){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=1)}([function(n,e){n.exports=t},function(t,n,e){"use strict";e.r(n),e.d(n,"coerce",function(){return d}),e.d(n,"coerceTime",function(){return s}),e.d(n,"format",function(){return p}),e.d(n,"diff",function(){return m}),e.d(n,"plus",function(){return M}),e.d(n,"minus",function(){return y}),e.d(n,"today",function(){return b}),e.d(n,"valid",function(){return h}),e.d(n,"validTime",function(){return v});var r=e(0),o=e.n(r);const u=/^(\d{4})-(\d{2})-(\d{2})$/,f=/^(\d{2}):(\d{2})$/,i="Invalid";function c(t){const n=function(t){if(t&&"string"==typeof t){const n=u.exec(t);if(n)return[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]}return null}(t);if(!n||n.includes(NaN))return NaN;let[e,r,o]=n;return r=(r+9)%12,365*(e-=Math.floor(r/10))+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400)+Math.floor((306*r+5)/10)+(o-1)}function a(t){if(Number.isNaN(t))return i;let n=Math.floor((1e4*t+14780)/3652425),e=t-(365*n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400));e<0&&(e=t-(365*(n-=1)+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400)));let r=Math.floor((100*e+52)/3060),o=(r+2)%12+1;return l(n+=Math.floor((r+2)/12),o,e-Math.floor((306*r+5)/10)+1)}function l(t,n,e){return t.toString().padStart(4,"0")+"-"+n.toString().padStart(2,"0")+"-"+e.toString().padStart(2,"0")}function d(t){return o.a.isMoment(t)?t.format("YYYY-MM-DD"):t}function s(t){return o.a.isMoment(t)?t.format("HH:mm"):t}function p(t){return o()(t,"YYYY-MM-DD",!0).format("L")}function m(t,n){return c(n)-c(t)}function M(t,n){return a(c(t)+n)}function y(t,n){return a(c(t)-n)}function b(){const t=o()();return l(t.year(),t.month()+1,t.date())}function h(t){return t!==i&&t===a(c(t))}function v(t){if(t&&"string"==typeof t){const n=f.exec(t);if(n){const t=parseInt(n[1]),e=parseInt(n[2]);return t>=0&&t<=23&&e>=0&&e<=59}}return!1}}])}); | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("moment-timezone")):"function"==typeof define&&define.amd?define(["moment-timezone"],n):"object"==typeof exports?exports["timetable-fns"]=n(require("moment-timezone")):t["timetable-fns"]=n(t.moment)}("undefined"!=typeof self?self:this,function(t){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=1)}([function(n,e){n.exports=t},function(t,n,e){"use strict";e.r(n),e.d(n,"coerce",function(){return d}),e.d(n,"coerceTime",function(){return s}),e.d(n,"format",function(){return p}),e.d(n,"diff",function(){return m}),e.d(n,"plus",function(){return M}),e.d(n,"minus",function(){return y}),e.d(n,"today",function(){return b}),e.d(n,"valid",function(){return h}),e.d(n,"validTime",function(){return v});var r=e(0),o=e.n(r);const u=/^(\d{4})-(\d{2})-(\d{2})$/,f=/^(\d{2}):(\d{2})$/,i="Invalid";function c(t){const n=function(t){if(t&&"string"==typeof t){const n=u.exec(t);if(n)return[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]}return null}(t);if(!n||n.includes(NaN))return NaN;let[e,r,o]=n;return r=(r+9)%12,365*(e-=Math.floor(r/10))+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400)+Math.floor((306*r+5)/10)+(o-1)}function a(t){if(Number.isNaN(t))return i;let n=Math.floor((1e4*t+14780)/3652425),e=t-(365*n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400));e<0&&(e=t-(365*(n-=1)+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400)));let r=Math.floor((100*e+52)/3060),o=(r+2)%12+1;return l(n+=Math.floor((r+2)/12),o,e-Math.floor((306*r+5)/10)+1)}function l(t,n,e){return t.toString().padStart(4,"0")+"-"+n.toString().padStart(2,"0")+"-"+e.toString().padStart(2,"0")}function d(t){return o.a.isMoment(t)?t.format("YYYY-MM-DD"):t}function s(t){return o.a.isMoment(t)?t.format("HH:mm"):t}function p(t){return o()(t,"YYYY-MM-DD",!0).format("L")}function m(t,n){return c(n)-c(t)}function M(t,n){return a(c(t)+n)}function y(t,n){return a(c(t)-n)}function b(){const t=o()();return l(t.year(),t.month()+1,t.date())}function h(t){return t!==i&&t===a(c(t))}function v(t){if(t&&"string"==typeof t){const n=f.exec(t);if(n){const t=parseInt(n[1]),e=parseInt(n[2]);return t>=0&&t<=23&&e>=0&&e<=59}}return!1}}])}); |
{ | ||
"name": "timetable-fns", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Useful date and time utility functions for working with timetables.", | ||
@@ -5,0 +5,0 @@ "main": "dist/timetable-fns.js", |
@@ -16,3 +16,4 @@ const path = require('path') | ||
library: 'timetable-fns', | ||
libraryTarget: 'umd' | ||
libraryTarget: 'umd', | ||
globalObject: "typeof self !== 'undefined' ? self : this" | ||
}, | ||
@@ -19,0 +20,0 @@ externals: { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
135554
117
0