Skip to content

Date Utilities

DateUtilities class to handle date-related operations.

Classes:

Name Description
Day

Enum for days of the week.

DateStat

Enum for date statistics.

DateUtilities

DateUtilities class to handle date-related operations.

Day

Bases: IntEnum

Enum for days of the week.

DateStat

Bases: StrEnum

Enum for date statistics.

DateUtilities

DateUtilities class to handle date-related operations.

Methods:

Name Description
next

Return the date of the next day.

range

Compute the range between two dates in days, weeks, months, and years.

stats

Get statistics about the timeline.

append_ordinal_to_day

Get day of month with ordinal suffix (1st, 2nd, 3rd, 4th, etc.).

journals_to_datetime

Convert journal keys from strings to datetime objects.

compile_datetime_tokens

Set the regex pattern for date tokens.

cljs_date_to_py

Convert a Clojure-style date format to a Python-style date format.

next(date_obj: datetime) -> datetime staticmethod

Return the date of the next day.

range(stats: dict[str, datetime]) -> dict[str, float | None] staticmethod

Compute the range between two dates in days, weeks, months, and years.

stats(dates: list[datetime]) -> dict[str, Any] staticmethod

Get statistics about the timeline.

append_ordinal_to_day(day: str) -> str staticmethod

Get day of month with ordinal suffix (1st, 2nd, 3rd, 4th, etc.).

journals_to_datetime(keys: Iterable[str], py_page_format: str = '') -> Iterator[datetime] staticmethod

Convert journal keys from strings to datetime objects.

compile_datetime_tokens() -> re.Pattern staticmethod

Set the regex pattern for date tokens.

cljs_date_to_py(cljs_format: str, token_pattern: re.Pattern) -> str staticmethod

Convert a Clojure-style date format to a Python-style date format.