From f0b8fa2b1330ea00faf694817cdf0289673b8c56 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期三, 14 九月 2022 16:27:35 +0800 Subject: [PATCH] Merge branch 'master' of ssh://192.168.0.10:29418/pcalife/PAM --- 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