保誠-保戶業務員媒合平台
wayne
2022-01-26 6fa4bba623713c396432ba8b863846883d6a1906
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;