From 7294eb12a90eb039622c881e220c5e041267ff84 Mon Sep 17 00:00:00 2001 From: jiaosong <jiaosong6760@dingtalk.com> Date: 星期三, 23 八月 2023 16:55:10 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- screen_standard/src/utils/index.js | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/screen_standard/src/utils/index.js b/screen_standard/src/utils/index.js index 3dd9429..25fcbea 100644 --- a/screen_standard/src/utils/index.js +++ b/screen_standard/src/utils/index.js @@ -1,4 +1,16 @@ export function getAssets(url) { // console.log(url, new URL(`../assets/img/${url}`, import.meta.url).href); return new URL(`../assets/img/${url}`, import.meta.url).href +} + +export function dateToSub(date) { + if (!date) { + return '-' + } + let tempDate = new Date(date) + let month = tempDate.getMonth()+1 + let day = tempDate.getDate() + let hours = tempDate.getHours() + let minute = tempDate.getMinutes() + return `${month<10?`0${month}`:month}-${day<10?`0${day}`:day} ${hours<10?`0${hours}`:hours}:${minute<10?`0${minute}`:minute}` } \ No newline at end of file -- Gitblit v1.9.3