callumalpass_tasknotes/tests/unit/issues
Callum Alpass b4d52c707d feat: Implement UTC Anchor principle for robust timezone handling
This commit introduces the UTC Anchor principle to eliminate timezone-related bugs
and provide consistent date handling across all user timezones.

## Key Changes:

### Core Implementation
- Add `parseDateToUTC()` function that creates UTC anchors for date-only strings
- Add `parseDateToLocal` alias for existing `parseDate` function
- Deprecate direct `parseDate` usage with clear migration path
- Update date comparison functions to use UTC anchors

### Updated Components
- **dateUtils.ts**: New UTC parsing functions and updated comparisons
- **main.ts**: Use UTC anchor for selectedDate initialization
- **MiniCalendarView**: Navigate using UTC anchors
- **TimeblockCreationModal**: Fix timezone handling
- **Multiple test files**: Fix timezone assumptions in tests

### Refactored parseDate Usage
- **UnscheduledTasksSelectorModal**: Use parseDateToLocal for UI display
- **AdvancedCalendarView**: Use parseDateToLocal for calendar events
- **helpers.ts**: Use parseDateToUTC for internal date logic
- **FilterService**: Already using updated utilities

### Documentation
- Add comprehensive UTC Anchor implementation docs
- Update development guidelines with date handling best practices
- Add migration guide for existing code
- Include quick reference for date functions

## Benefits:
- Eliminates "off-by-one day" errors across timezones
- Provides consistent sorting and filtering behavior
- Simplifies date comparison logic
- Future-proofs against timezone-related bugs

## Testing:
- All 798 tests passing
- New UTC anchor test suite (11 tests)
- No regression in existing functionality

Fixes #327, #322, #314 and other timezone-related issues
2025-08-02 22:54:11 +10:00
..
calendar-recurrence-off-by-one-bug.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
comprehensive-timezone-recurrence-bug.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
due-date-time-component-bug.test.ts feat: Implement UTC Anchor principle for robust timezone handling 2025-08-02 22:54:11 +10:00
due-date-timezone-fix-verification.test.ts feat: Implement UTC Anchor principle for robust timezone handling 2025-08-02 22:54:11 +10:00
due-date-timezone-inconsistency.test.ts feat: Implement UTC Anchor principle for robust timezone handling 2025-08-02 22:54:11 +10:00
first-day-week-calendar-off-by-one.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
issue-160-date-formatting-inconsistency.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
issue-160-modal-vs-service-inconsistency.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
issue-160-off-by-one-completions.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
issue-160-simple-fix-verification.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
issue-314-complete-instances-timezone-bug.test.ts feat: Implement UTC Anchor principle for robust timezone handling 2025-08-02 22:54:11 +10:00
issue-322-completion-calendar-timezone-bug.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
issue-322-exact-reproduction.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
issue-322-failing-reproduction.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
issue-322-regression-prevention.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
issue-327-failing-test.test.ts feat: Implement UTC Anchor principle for robust timezone handling 2025-08-02 22:54:11 +10:00
issue-327-integration-test.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
issue-327-recurring-task-wrong-day.test.ts feat: Implement UTC Anchor principle for robust timezone handling 2025-08-02 22:54:11 +10:00
issue-327-reverse-bug.test.ts feat: Implement UTC Anchor principle for robust timezone handling 2025-08-02 22:54:11 +10:00
issue-327-timezone-simulation.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
issue-context-menu-completion-date-bug.test.ts feat: Implement UTC Anchor principle for robust timezone handling 2025-08-02 22:54:11 +10:00
issue-context-menu-completion-date-corrected-fix.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
issue-context-menu-completion-date-fix.test.ts feat: Implement UTC Anchor principle for robust timezone handling 2025-08-02 22:54:11 +10:00
july-2025-monday-tuesday-off-by-one-bug.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
off-by-one-completion-timezone-bug.test.ts feat: Implement UTC Anchor principle for robust timezone handling 2025-08-02 22:54:11 +10:00
task-edit-modal-calendar-off-by-one-bug.test.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
timezone-safety-analysis.test.ts test: Add timezone safety analysis and additional verification tests 2025-07-13 16:22:01 +10:00