diff --git a/src/components/SaleCountdown.tsx b/src/components/SaleCountdown.tsx index 753d5b2..515229f 100644 --- a/src/components/SaleCountdown.tsx +++ b/src/components/SaleCountdown.tsx @@ -31,8 +31,11 @@ export function SaleCountdown({ hasActiveSale, maxSalePercentage = 5, saleEndDat let targetDate: Date; if (saleEndDate) { - // Use the sale end date from admin + // Use the sale end date from admin - ensure proper timezone handling targetDate = new Date(saleEndDate); + console.log('Sale end date from DB:', saleEndDate); + console.log('Parsed target date:', targetDate); + console.log('Current time:', now); } else { // Fallback to next Sunday at 23:59:59 const nextSunday = new Date(); @@ -45,6 +48,8 @@ export function SaleCountdown({ hasActiveSale, maxSalePercentage = 5, saleEndDat } const difference = targetDate.getTime() - now.getTime(); + console.log('Time difference (ms):', difference); + console.log('Days:', Math.floor(difference / (1000 * 60 * 60 * 24))); if (difference > 0) { return {