callumalpass_tasknotes/tests
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
..
__mocks__ fix: Add missing setTooltip mock to fix failing tests 2025-07-27 19:31:00 +10:00
helpers Refactor Types, Mocks, and Test Helpers for Improved Type Safety and Consistency 2025-06-24 22:07:31 +10:00
integration fix(tests): Fix migration workflow test for YAML parsing errors 2025-07-13 00:35:03 +10:00
unit feat: Implement UTC Anchor principle for robust timezone handling 2025-08-02 22:54:11 +10:00
coverage-report.md test: add comprehensive tests for Issue #160 off-by-one date bugs 2025-07-11 23:06:37 +10:00
test-setup.ts Refactor Types, Mocks, and Test Helpers for Improved Type Safety and Consistency 2025-06-24 22:07:31 +10:00