From 4fbbc2b1cf0f5af0ea655cc0c803b3fb8b74a142 Mon Sep 17 00:00:00 2001 From: "Calum H." Date: Tue, 9 Dec 2025 08:44:04 +0000 Subject: [PATCH] feat: use utc during balance bar calcs (#4875) --- apps/frontend/src/pages/dashboard/revenue/index.vue | 4 ++-- apps/frontend/src/plugins/dayjs.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/frontend/src/pages/dashboard/revenue/index.vue b/apps/frontend/src/pages/dashboard/revenue/index.vue index 44dc1339a..98bbdcb65 100644 --- a/apps/frontend/src/pages/dashboard/revenue/index.vue +++ b/apps/frontend/src/pages/dashboard/revenue/index.vue @@ -418,14 +418,14 @@ const processingDate = computed<{ date: string; amount: number }>(() => { const nextDates = nextDate.value if (!nextDates.length) return { date: '', amount: 0 } - const now = dayjs() + const now = dayjs.utc() const currentMonth = now.format('YYYY-MM') // Find revenue from the current month (still "processing") // Revenue earned in month X becomes available at end_of_month(X) + 60 days // So we calculate: source_month = (date_available - 60 days).startOf('month') for (const { date, amount } of nextDates) { - const availableDate = dayjs(date) + const availableDate = dayjs.utc(date) const sourceMonthEnd = availableDate.subtract(60, 'days') const sourceMonth = sourceMonthEnd.startOf('month').format('YYYY-MM') diff --git a/apps/frontend/src/plugins/dayjs.js b/apps/frontend/src/plugins/dayjs.js index b44b821c6..f214178ae 100644 --- a/apps/frontend/src/plugins/dayjs.js +++ b/apps/frontend/src/plugins/dayjs.js @@ -2,9 +2,11 @@ import dayjs from 'dayjs' import advanced from 'dayjs/plugin/advancedFormat' import quarterOfYear from 'dayjs/plugin/quarterOfYear' import relativeTime from 'dayjs/plugin/relativeTime' +import utc from 'dayjs/plugin/utc' dayjs.extend(quarterOfYear) dayjs.extend(advanced) +dayjs.extend(utc) dayjs.extend(relativeTime) export default defineNuxtPlugin(() => {