From 809ad95e4683410bcee522d0a03ff4520f6bed8f Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 4 Dec 2024 10:18:05 +0100 Subject: [PATCH 1/2] fix: hotfix date --- .../Supplier/Card/SupplierConsumption.vue | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/pages/Supplier/Card/SupplierConsumption.vue b/src/pages/Supplier/Card/SupplierConsumption.vue index fe1cec260..a4fcf8bcd 100644 --- a/src/pages/Supplier/Card/SupplierConsumption.vue +++ b/src/pages/Supplier/Card/SupplierConsumption.vue @@ -8,7 +8,7 @@ import SendEmailDialog from 'components/common/SendEmailDialog.vue'; import SupplierConsumptionFilter from './SupplierConsumptionFilter.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; -import { toDate } from 'src/filters'; +import { dateRange, toDate } from 'src/filters'; import { dashIfEmpty } from 'src/filters'; import { usePrintService } from 'composables/usePrintService'; import useNotify from 'src/composables/useNotify.js'; @@ -35,14 +35,20 @@ const store = arrayData.store; onUnmounted(() => state.unset('SupplierConsumption')); const dateRanges = computed(() => { - const { from, to } = arrayData.store?.userParams || {}; + let { from, to } = arrayData.store?.userParams || {}; return { from, to }; }); -const reportParams = computed(() => ({ - recipientId: Number(route.params.id), - ...dateRanges.value, -})); +const reportParams = computed(() => { + const dates = { + to: dateRange(dateRanges.value.to)[1].toISOString(), + from: dateRange(dateRanges.value.from)[1].toISOString(), + }; + return { + recipientId: Number(route.params.id), + ...dates, + }; +}); async function getSupplierConsumptionData() { await arrayData.fetch({ append: false }); From 884138af480115b8bb9524aafda7d5217cc7eb81 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 10 Dec 2024 12:33:53 +0100 Subject: [PATCH 2/2] fix: remove Iso --- src/pages/Supplier/Card/SupplierConsumption.vue | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/pages/Supplier/Card/SupplierConsumption.vue b/src/pages/Supplier/Card/SupplierConsumption.vue index a4fcf8bcd..6e2ea14bf 100644 --- a/src/pages/Supplier/Card/SupplierConsumption.vue +++ b/src/pages/Supplier/Card/SupplierConsumption.vue @@ -40,13 +40,10 @@ const dateRanges = computed(() => { }); const reportParams = computed(() => { - const dates = { - to: dateRange(dateRanges.value.to)[1].toISOString(), - from: dateRange(dateRanges.value.from)[1].toISOString(), - }; return { recipientId: Number(route.params.id), - ...dates, + to: dateRange(dateRanges.value.to)[1], + from: dateRange(dateRanges.value.from)[1], }; });