From 899db04bdfeef4c605fb52d2bd891cd53103529f Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Mon, 24 Jun 2024 08:28:53 +0000 Subject: [PATCH] fix(nc-gui): update audit date range logic --- .../nc-gui/components/workspace/AuditLogs.vue | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/packages/nc-gui/components/workspace/AuditLogs.vue b/packages/nc-gui/components/workspace/AuditLogs.vue index bd20e6444b..b3d16eef4c 100644 --- a/packages/nc-gui/components/workspace/AuditLogs.vue +++ b/packages/nc-gui/components/workspace/AuditLogs.vue @@ -228,16 +228,16 @@ const handleUpdateDateRange = (range?: AuditLogsDateRange, label?: string) => { auditLogsQuery.value.endDate = now.format('YYYY-MM-DD HH:mm:ssZ') break case AuditLogsDateRange.PastWeek: - auditLogsQuery.value.startDate = now.subtract(1, 'week').startOf('day').format('YYYY-MM-DD') - auditLogsQuery.value.endDate = now.subtract(1, 'week').endOf('day').format('YYYY-MM-DD') + auditLogsQuery.value.startDate = now.subtract(7, 'days').format('YYYY-MM-DD HH:mm:ssZ') + auditLogsQuery.value.endDate = now.format('YYYY-MM-DD HH:mm:ssZ') break case AuditLogsDateRange.PastMonth: - auditLogsQuery.value.startDate = now.subtract(1, 'month').startOf('month').format('YYYY-MM-DD') - auditLogsQuery.value.endDate = now.subtract(1, 'month').endOf('month').format('YYYY-MM-DD') + auditLogsQuery.value.startDate = now.subtract(30, 'days').format('YYYY-MM-DD HH:mm:ssZ') + auditLogsQuery.value.endDate = now.format('YYYY-MM-DD HH:mm:ssZ') break case AuditLogsDateRange.PastYear: - auditLogsQuery.value.startDate = now.subtract(1, 'year').startOf('year').format('YYYY-MM-DD') - auditLogsQuery.value.endDate = now.subtract(1, 'year').endOf('year').format('YYYY-MM-DD') + auditLogsQuery.value.startDate = now.subtract(365, 'days').format('YYYY-MM-DD HH:mm:ssZ') + auditLogsQuery.value.endDate = now.format('YYYY-MM-DD HH:mm:ssZ') break default: auditLogsQuery.value.startDate = undefined @@ -734,7 +734,7 @@ onMounted(async () => {