Liking cljdoc? Tell your friends :D

brazilian-utils.date.internal

Internal helper functions for date operations.

Internal helper functions for date operations.
raw docstring

build-holiday-dates-setclj/s

(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
sourceraw docstring

build-holiday-name-mapclj/s

(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
sourceraw docstring

extract-yearclj/s

(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
sourceraw docstring

validate-and-extract-date-infoclj/s

(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
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close