Extract shared date utility functions #13
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context: Several date manipulation patterns are repeated throughout the codebase:
.toISOString().split('T')[0]for date formatting (11+ occurrences)setHours(0, 0, 0, 0)for day boundary normalization (multiple files)Files affected:
backend/src/drivers/schedule-export.service.ts(lines 39-43, 414-415, 438-439)backend/src/copilot/copilot.service.ts(line 75)backend/src/flights/flights.service.ts(lines 77-91)Suggested fix:
backend/src/common/utils/date.utils.tswith:toDateString(date: Date): stringstartOfDay(date: Date): DateconvertOptionalDates(obj, fields)Effort: Trivial
Created with , , and . Updated all 10+ files.