From cedd1f296cdb1b14cdb4e7d1c5c080e507c7eeb1 Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期四, 23 十二月 2021 09:13:30 +0800
Subject: [PATCH] refactor: layouts/default.vue

---
 PAMapp/plugins/filters/date.filter.ts |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/PAMapp/plugins/filters/date.filter.ts b/PAMapp/plugins/filters/date.filter.ts
index 281c148..069a7af 100644
--- a/PAMapp/plugins/filters/date.filter.ts
+++ b/PAMapp/plugins/filters/date.filter.ts
@@ -24,12 +24,14 @@
     return compareDate.getFullYear() === today.getFullYear();
   };
 
+  const minutes = date.getMinutes() > 9 ?  date.getMinutes() : `0${date.getMinutes()}`;
+
   if (isThisYear(date)) {
     return isToday(date)
-          ? `隞予 ${date.getHours()}:${date.getMinutes()}`
-          : `${date.getMonth() + 1}���${date.getDate()}� ${date.getHours()}:${date.getMinutes()}`;
+          ? `隞予 ${date.getHours()}:${minutes}`
+          : `${date.getMonth() + 1}���${date.getDate()}� ${date.getHours()}:${minutes}`;
   } else {
-    return `${date.getFullYear()}撟�${date.getMonth() + 1}���${date.getDate()}� ${date.getHours()}:${date.getMinutes()}`;
+    return `${date.getFullYear()}撟�${date.getMonth() + 1}���${date.getDate()}� ${date.getHours()}:${minutes}`;
   };
 
 })

--
Gitblit v1.8.0