Module date_utils

Module date_utils 

Source
Expand description

Date validation and conversion utilities for Things 3

This module provides safe date conversion between Things 3’s internal format (seconds since 2001-01-01) and standard date types, along with comprehensive validation to ensure date consistency.

Enums§

DateConversionError
Errors that can occur during date conversion
DateValidationError
Errors that can occur during date validation

Functions§

add_days
Add days to a date with overflow checking
format_date_for_display
Format a date for display, handling None gracefully
is_date_in_future
Check if a date is in the future
is_date_in_past
Check if a date is in the past
is_valid_things_timestamp
Check if a Things 3 timestamp is within a reasonable range
parse_date_from_string
Parse a date from a string, supporting multiple formats
safe_naive_date_to_things_timestamp
Convert NaiveDate to Things 3 timestamp with validation
safe_things_date_to_naive_date
Convert Things 3 timestamp to NaiveDate with comprehensive error handling
validate_date_range
Validate that a deadline is not before a start date