+1
-1
@@ -1,2 +0,2 @@ | ||
| function t(t,n,r,e){var u=n,o=r,a=e,i=t;return{rand:function(){return(i=(o*i+a)%u)/u}}}var n=function(t,n){for(var r=[],e=0;e<n;e++)r.push(t.rand());for(var u=r.slice().sort(),o=0;o<u.length;o++)r[r.indexOf(u[o])]=o;return r};exports.fromDate=function(r){var e=function(t){var n=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),e=t.getDate().toString().padStart(2,"0"),u=t.getHours().toString().padStart(2,"0");return{minute:parseInt(""+n+r+e+u),hour:parseInt(""+n+r+e)}}(r),u=function(n){return t(n,2147483647,48271,0)}(e.minute),o=n(u,60),a=function(n){return t(n,4294967296,1664525,1013904223)}(e.hour),i={hour:n(a,24)[r.getHours()],minute:o[r.getMinutes()],second:r.getSeconds()};return Object.assign({},i,{toDate:function(){return function(t,n){var r=new Date(n.getTime());return r.setHours(t.hour),r.setMinutes(t.minute),r.setSeconds(t.second),r}(i,r)}})}; | ||
| function t(t,n,r,e){var u=n,o=r,a=e,i=t;return{rand:function(){return(i=(o*i+a)%u)/u}}}var n=function(t,n){for(var r=[],e=0;e<n;e++)r.push(t.rand());for(var u=r.slice().sort(),o=0;o<u.length;o++)r[r.indexOf(u[o])]=o;return r},r=function(r){var e=function(t){var n=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),e=t.getDate().toString().padStart(2,"0"),u=t.getHours().toString().padStart(2,"0");return{minute:parseInt(""+n+r+e+u),hour:parseInt(""+n+r+e)}}(r),u=function(n){return t(n,2147483647,48271,0)}(e.minute),o=n(u,60),a=function(n){return t(n,4294967296,1664525,1013904223)}(e.hour),i={hour:n(a,24)[r.getHours()],minute:o[r.getMinutes()],second:r.getSeconds()};return Object.assign({},i,{toDate:function(){return function(t,n){var r=new Date(n.getTime());return r.setHours(t.hour),r.setMinutes(t.minute),r.setSeconds(t.second),r}(i,r)}})};exports.fromDate=r,exports.fromNow=function(){return r(new Date)}; | ||
| //# sourceMappingURL=flowtime.js.map |
@@ -1,2 +0,2 @@ | ||
| function t(t,n,r,e){var u=n,o=r,a=e,i=t;return{rand:function(){return(i=(o*i+a)%u)/u}}}var n=function(t,n){for(var r=[],e=0;e<n;e++)r.push(t.rand());for(var u=r.slice().sort(),o=0;o<u.length;o++)r[r.indexOf(u[o])]=o;return r},r=function(r){var e=function(t){var n=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),e=t.getDate().toString().padStart(2,"0"),u=t.getHours().toString().padStart(2,"0");return{minute:parseInt(""+n+r+e+u),hour:parseInt(""+n+r+e)}}(r),u=function(n){return t(n,2147483647,48271,0)}(e.minute),o=n(u,60),a=function(n){return t(n,4294967296,1664525,1013904223)}(e.hour),i={hour:n(a,24)[r.getHours()],minute:o[r.getMinutes()],second:r.getSeconds()};return Object.assign({},i,{toDate:function(){return function(t,n){var r=new Date(n.getTime());return r.setHours(t.hour),r.setMinutes(t.minute),r.setSeconds(t.second),r}(i,r)}})};export{r as fromDate}; | ||
| function t(t,n,r,e){var u=n,o=r,a=e,i=t;return{rand:function(){return(i=(o*i+a)%u)/u}}}var n=function(t,n){for(var r=[],e=0;e<n;e++)r.push(t.rand());for(var u=r.slice().sort(),o=0;o<u.length;o++)r[r.indexOf(u[o])]=o;return r},r=function(r){var e=function(t){var n=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),e=t.getDate().toString().padStart(2,"0"),u=t.getHours().toString().padStart(2,"0");return{minute:parseInt(""+n+r+e+u),hour:parseInt(""+n+r+e)}}(r),u=function(n){return t(n,2147483647,48271,0)}(e.minute),o=n(u,60),a=function(n){return t(n,4294967296,1664525,1013904223)}(e.hour),i={hour:n(a,24)[r.getHours()],minute:o[r.getMinutes()],second:r.getSeconds()};return Object.assign({},i,{toDate:function(){return function(t,n){var r=new Date(n.getTime());return r.setHours(t.hour),r.setMinutes(t.minute),r.setSeconds(t.second),r}(i,r)}})},e=function(){return r(new Date)};export{r as fromDate,e as fromNow}; | ||
| //# sourceMappingURL=flowtime.mjs.map |
@@ -1,2 +0,2 @@ | ||
| !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.flowtime={})}(this,function(t){function e(t,e,n,r){var o=e,u=n,i=r,a=t;return{rand:function(){return(a=(u*a+i)%o)/o}}}var n=function(t,e){for(var n=[],r=0;r<e;r++)n.push(t.rand());for(var o=n.slice().sort(),u=0;u<o.length;u++)n[n.indexOf(o[u])]=u;return n};t.fromDate=function(t){var r=function(t){var e=t.getFullYear(),n=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0"),o=t.getHours().toString().padStart(2,"0");return{minute:parseInt(""+e+n+r+o),hour:parseInt(""+e+n+r)}}(t),o=function(t){return e(t,2147483647,48271,0)}(r.minute),u=n(o,60),i=function(t){return e(t,4294967296,1664525,1013904223)}(r.hour),a={hour:n(i,24)[t.getHours()],minute:u[t.getMinutes()],second:t.getSeconds()};return Object.assign({},a,{toDate:function(){return function(t,e){var n=new Date(e.getTime());return n.setHours(t.hour),n.setMinutes(t.minute),n.setSeconds(t.second),n}(a,t)}})}}); | ||
| !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.flowtime={})}(this,function(t){function n(t,n,e,r){var o=n,u=e,i=r,f=t;return{rand:function(){return(f=(u*f+i)%o)/o}}}var e=function(t,n){for(var e=[],r=0;r<n;r++)e.push(t.rand());for(var o=e.slice().sort(),u=0;u<o.length;u++)e[e.indexOf(o[u])]=u;return e},r=function(t){var r=function(t){var n=t.getFullYear(),e=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0"),o=t.getHours().toString().padStart(2,"0");return{minute:parseInt(""+n+e+r+o),hour:parseInt(""+n+e+r)}}(t),o=function(t){return n(t,2147483647,48271,0)}(r.minute),u=e(o,60),i=function(t){return n(t,4294967296,1664525,1013904223)}(r.hour),f={hour:e(i,24)[t.getHours()],minute:u[t.getMinutes()],second:t.getSeconds()};return Object.assign({},f,{toDate:function(){return function(t,n){var e=new Date(n.getTime());return e.setHours(t.hour),e.setMinutes(t.minute),e.setSeconds(t.second),e}(f,t)}})};t.fromDate=r,t.fromNow=function(){return r(new Date)}}); | ||
| //# sourceMappingURL=flowtime.umd.js.map |
+1
-1
| { | ||
| "name": "flowtime", | ||
| "version": "1.1.2", | ||
| "version": "1.2.0", | ||
| "description": "An unpredictable time library for JavaScript", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
+2
-2
@@ -38,3 +38,3 @@ # ~ flowtime ~ | ||
| ```js | ||
| import { fromDate } from 'flowtime' | ||
| import { fromNow, fromDate } from 'flowtime' | ||
| ``` | ||
@@ -52,3 +52,3 @@ | ||
| The library exposes a single function, `fromDate` which takes a JavaScript `Date` as argument and returns a flow time object. | ||
| The library exposes two functions, `fromNow` which returns the current flow time, and `fromDate` which takes a JavaScript `Date` as argument to returns its corresponding flow time. | ||
@@ -55,0 +55,0 @@ ```js |
10669
1.97%