From 73e2d7a0588df99219d0dab88f5c1b9d2f4bd8c3 Mon Sep 17 00:00:00 2001 From: hyy Date: Wed, 12 Jun 2024 12:34:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=20=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=B8=AD=20=E8=90=A5=E4=B8=9A=E6=97=B6=E9=97=B4=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=88=90=E6=97=A5=E6=9C=9F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yshop-drink-vue3/src/utils/formatTime.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/yshop-drink-vue3/src/utils/formatTime.ts b/yshop-drink-vue3/src/utils/formatTime.ts index 134a986..0b150c4 100644 --- a/yshop-drink-vue3/src/utils/formatTime.ts +++ b/yshop-drink-vue3/src/utils/formatTime.ts @@ -202,13 +202,24 @@ export function dateFormatter(_row: any, _column: TableColumnCtx, cellValue } /** - * element plus 的时间 Formatter 实现,使用 YYYY-MM-DD 格式 + * element plus 的时间 Formatter 实现,使用 HH:mm:ss 格式 * * @param row 行数据 * @param column 字段 * @param cellValue 字段值 */ export function dateFormatter2(_row: any, _column: TableColumnCtx, cellValue: any): string { + return cellValue ? formatDate(cellValue, 'HH:mm:ss') : '' +} + +/** + * element plus 的时间 Formatter 实现,使用 YYYY-MM-DD 格式 + * + * @param row 行数据 + * @param column 字段 + * @param cellValue 字段值 + */ +export function dateFormatter3(_row: any, _column: TableColumnCtx, cellValue: any): string { return cellValue ? formatDate(cellValue, 'YYYY-MM-DD') : '' }