You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
684 B

"use strict";const r=require("../../common/vendor.js");require("../store/index.js");require("../config/index.js");function a(n,e=""){n=s(n),e===""&&(e=r.dayjs());let u=r.ref(n-e);u.value>0&&setTimeout(()=>{u.value>0&&(u.value-=1e3)},1e3);let t=r.dayjs.duration(u.value);return{h:(t.months()*30*24+t.days()*24+t.hours()).toString().padStart(2,"0"),m:t.minutes().toString().padStart(2,"0"),s:t.seconds().toString().padStart(2,"0"),ms:t.$ms}}function s(n){if(n=n.toString(),n.indexOf("-")>0)return r.dayjs(n);if(n.length>10)return r.dayjs(parseInt(n));if(n.length===10)return r.dayjs.unix(parseInt(n))}function i(n){return(n/100).toFixed(2)}exports.fen2yuan=i;exports.useDurationTime=a;