UNPKG

press-shared

Version:
2 lines (1 loc) 953 B
(function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.voiceShared={}))})(this,function(e){"use strict";const n={get S(){return 1},get s(){return this.S*1e3},get m(){return this.s*60},get h(){return this.m*60},get d(){return this.h*24},get w(){return this.d*7},get mo(){return this.d*30},get y(){return this.d*365}};function i(o,u="h"){const s=n[u],r=new Date;return[new Date(r.getTime()-o*s),r]}function t(o,u,s,r){return{type:r,text:s,value:i(o,u)}}function a(){return[t(.5,"h","最近半小时","last0.5Hour"),t(1,"h","最近一小时","last1Hour"),t(3,"h","最近三小时","last3Hour"),t(6,"h","最近六小时","last6Hour"),t(1,"d","最近一天","last1Day"),t(3,"d","最近三天","last3Day"),t(1,"w","最近一周","last1Week")]}e.createDateRangeShortcuts=a,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});