Internal helper functions for date operations.
Internal helper functions for date operations.
(build-holiday-dates-set holidays)Creates a set of holiday dates for quick lookup.
Pure function that transforms holiday list into a set.
Args: holidays - List of holiday maps with :date key
Returns: Set of date strings
Creates a set of holiday dates for quick lookup. Pure function that transforms holiday list into a set. Args: holidays - List of holiday maps with :date key Returns: Set of date strings
(build-holiday-name-map holidays)Creates a map from date to holiday name.
Pure function that transforms holiday list into a map.
Args: holidays - List of holiday maps with :date and :name keys
Returns: Map of date -> name
Creates a map from date to holiday name. Pure function that transforms holiday list into a map. Args: holidays - List of holiday maps with :date and :name keys Returns: Map of date -> name
(extract-year date)Safely extracts year from a date string. Accepts both ISO (YYYY-MM-DD) and Brazilian (DD/MM/YYYY) formats.
Args: date (string): Date in either format
Returns: Year as string, or nil if invalid
Examples: (extract-year "2024-01-15") ;; "2024" (extract-year "15/01/2024") ;; "2024" (extract-year "invalid") ;; nil
Safely extracts year from a date string. Accepts both ISO (YYYY-MM-DD) and Brazilian (DD/MM/YYYY) formats. Args: date (string): Date in either format Returns: Year as string, or nil if invalid Examples: (extract-year "2024-01-15") ;; "2024" (extract-year "15/01/2024") ;; "2024" (extract-year "invalid") ;; nil
(validate-and-extract-date-info date)Validates and extracts date information.
Pure function that normalizes date and extracts year.
Args: date - Date string in any supported format
Returns: Vector [normalized-date year] if valid, nil otherwise
Validates and extracts date information. Pure function that normalizes date and extracts year. Args: date - Date string in any supported format Returns: Vector [normalized-date year] if valid, nil otherwise
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |