callumalpass_tasknotes/src/utils
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
..
dateUtils.ts feat: Implement UTC Anchor principle for robust timezone handling 2025-08-02 22:54:11 +10:00
DOMReconciler.ts Refactor and cleanup various modules for improved type safety, streamlined DOM element creation, and updated legacy recurrence handling 2025-06-25 20:29:33 +10:00
DragDropManager.ts Enhance Drag & Drop Functionality 2025-06-13 19:33:26 +10:00
EventEmitter.ts Add DetailView, EventEmitter, and state-based view synchronization 2025-05-18 14:19:23 +10:00
filenameGenerator.ts feat: Add option to store task title exclusively in filename (#106) 2025-06-30 19:25:41 +10:00
FilterUtils.ts feat: Integrate natural language dates into filter evaluation 2025-07-13 16:22:01 +10:00
helpers.ts feat: Implement UTC Anchor principle for robust timezone handling 2025-08-02 22:54:11 +10:00
MinimalNativeCache.ts fix: Resolve TypeError when calling includes on non-array values 2025-07-20 07:21:10 +10:00
PerformanceMonitor.ts Refactor and cleanup various modules for improved type safety, streamlined DOM element creation, and updated legacy recurrence handling 2025-06-25 20:29:33 +10:00
pomodoroUtils.ts fix #136 2025-07-24 11:50:53 -04:00
RequestDeduplicator.ts Refactor and cleanup various modules for improved type safety, streamlined DOM element creation, and updated legacy recurrence handling 2025-06-25 20:29:33 +10:00
safeAsync.ts feat: Add ICS calendar event to content creation system (#120 #122 #220) 2025-07-20 13:27:13 +10:00
TasksPluginParser.ts refactor: Remove formatUTCDateForCalendar function 2025-08-02 10:04:49 +10:00
templateProcessor.ts feat: Add ICS event integration to field mapping and type system (#120 #122 #220) 2025-07-20 13:26:55 +10:00