Skip to content

Commit

Permalink
Fix: date handling in VehicleScheduler for improved month view calcul…
Browse files Browse the repository at this point in the history
…ations
  • Loading branch information
aelassas committed Jan 23, 2025
1 parent bc3e971 commit 337d972
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/src/components/VehicleScheduler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ const VehicleScheduler = (
suppliers,
statuses,
filter: {
from: query.view !== 'day' ? query.start : undefined,
// from: query.view !== 'day' ? query.start : undefined,
from: query.view !== 'day' ? new Date(query.start.getFullYear(), query.start.getMonth() - 1, 1) : undefined,
dateBetween: query.view === 'day' ? new Date(query.end.getFullYear(), query.end.getMonth(), query.end.getDate(), 0, 0, 0) : undefined,
to: query.view === 'month' ? query.end : new Date(query.end.getFullYear(), query.end.getMonth() + 1, 0),
// to: query.view === 'month' ? query.end : new Date(query.end.getFullYear(), query.end.getMonth() + 1, 0),
to: new Date(query.end.getFullYear(), query.end.getMonth() + 1, 0),
pickupLocation: filter?.pickupLocation,
dropOffLocation: filter?.dropOffLocation,
keyword: filter?.keyword,
Expand Down

0 comments on commit 337d972

Please sign in to comment.