From 6fa4bba623713c396432ba8b863846883d6a1906 Mon Sep 17 00:00:00 2001
From: wayne <wayne8692wayne8692@gmail.com>
Date: 星期三, 26 一月 2022 10:52:23 +0800
Subject: [PATCH] Merge branch 'pollex-dev' into sit

---
 PAMapp/components/Ui/UiDateFormat.vue |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/PAMapp/components/Ui/UiDateFormat.vue b/PAMapp/components/Ui/UiDateFormat.vue
index e9223b3..32f9651 100644
--- a/PAMapp/components/Ui/UiDateFormat.vue
+++ b/PAMapp/components/Ui/UiDateFormat.vue
@@ -13,7 +13,7 @@
     date!: Date | string;
 
     @Prop()
-    onlyShowSection!: 'DAY' | 'TIME';
+    onlyShowSection!: 'YEAR' | 'DATE' | 'DAY' | 'TIME';
 
     compareTarget!: Date;
     displayValue = '';
@@ -46,6 +46,12 @@
                         this.displayValue = isThisYear(compareTarget) ? thisYearDayLabel : `${compareTarget.getFullYear()}/${compareTarget.getMonth() + 1}/${compareTarget.getDate()}`;
                     } else if (this.onlyShowSection === 'TIME') {
                         this.displayValue = `${compareTarget.getHours()}:${minutes}`;
+                    } else if (this.onlyShowSection === 'DATE') {
+                        this.displayValue = isThisYear(compareTarget)
+                            ? thisYearDayLabel
+                            : `${compareTarget.getMonth() + 1}/${compareTarget.getDate()}`;
+                    } else if (this.onlyShowSection === 'YEAR') {
+                        this.displayValue = `${compareTarget.getFullYear()}`;
                     }
 
                     if (this.onlyShowSection) return;

--
Gitblit v1.8.0