press-shared
Version:
2 lines (1 loc) • 779 B
JavaScript
var voiceShared=function(r){"use strict";const s={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 o(n,u="h"){const a=s[u],e=new Date;return[new Date(e.getTime()-n*a),e]}function t(n,u,a,e){return{type:e,text:a,value:o(n,u)}}function i(){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")]}return r.createDateRangeShortcuts=i,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r}({});