🐛 Fix mixed UTC logic

This commit is contained in:
itskovacs 2025-11-11 19:29:11 +01:00
parent d6a5d65d88
commit 92a97edd3c
2 changed files with 2 additions and 2 deletions

View File

@ -113,7 +113,7 @@ export class TripsComponent implements OnInit {
const tripDays: Partial<TripDay>[] = []; const tripDays: Partial<TripDay>[] = [];
const current = new Date(from); const current = new Date(from);
while (current <= to) { while (current <= to) {
const year = current.getUTCFullYear(); const year = current.getFullYear();
const month = String(current.getMonth() + 1).padStart(2, '0'); const month = String(current.getMonth() + 1).padStart(2, '0');
const day = String(current.getDate()).padStart(2, '0'); const day = String(current.getDate()).padStart(2, '0');
const label = `${day} ${months[current.getMonth()]}`; const label = `${day} ${months[current.getMonth()]}`;

View File

@ -36,7 +36,7 @@ export class TripCreateDayModalComponent {
} }
formatDateWithoutTimezone(date: Date) { formatDateWithoutTimezone(date: Date) {
const year = date.getUTCFullYear(); const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0'); const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`; return `${year}-${month}-${day}`;