From 26558a7c975c403feaa1124d931df02bc4684208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=9A=A9=ED=83=9C?= Date: Tue, 11 Mar 2025 19:58:36 +0900 Subject: [PATCH] fix(widget-date-range): apply date-range api query policy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 박용태 --- .../modules/widgets/_composables/use-widget-date-range.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/common/modules/widgets/_composables/use-widget-date-range.ts b/apps/web/src/common/modules/widgets/_composables/use-widget-date-range.ts index 687e950a1b..1a5853bce9 100644 --- a/apps/web/src/common/modules/widgets/_composables/use-widget-date-range.ts +++ b/apps/web/src/common/modules/widgets/_composables/use-widget-date-range.ts @@ -39,7 +39,7 @@ export const useWidgetDateRange = (options: UseWidgetDateRangeOptions): UseWidge const state = reactive({ granularity: computed(() => _granularityInfo.value?.granularity ?? 'MONTHLY'), isInherit: computed(() => !!options.dateRangeFieldValue.value?.inherit), - dateRangeOptions: computed(() => options.dateRangeFieldValue.value?.options || 'auto'), + dateRangeOptions: computed(() => options.dateRangeFieldValue.value?.options || { value: 'auto' }), baseOnDate: computed(() => (state.isInherit ? _baseOnDate.value : undefined)), dateRange: computed(() => { const dateRangePresetKey = state.dateRangeOptions?.value || 'auto'; @@ -123,7 +123,7 @@ export const useWidgetDateRange = (options: UseWidgetDateRangeOptions): UseWidge const _date = baseDate.date(); const isEndOfMonth = _date === baseDate.endOf('month').date(); - _start = baseDate.subtract(isEndOfMonth ? baseMonthDayCount - 1 : 29, 'day').format('YYYY-MM-DD'); + _start = isEndOfMonth ? baseDate.subtract(baseMonthDayCount - 1, 'day').format('YYYY-MM-DD') : baseDate.subtract(1, 'month').add(1, 'day').format('YYYY-MM-DD'); _end = baseDate.format('YYYY-MM-DD'); } else if (relativeDateRangeValue === 'today') { _start = baseDate.format('YYYY-MM-DD');