Liking cljdoc? Tell your friends :D

vaelii.impl.datetime

Reads the time terms — a DatetimeFn reduced-precision ISO string, the calendar constructors YearFn / MonthFn / DayFn, a DatetimeRangeFn range and the InstantFn moment — to integer field vectors. Field nesting is calendar containment (subinterval?, docs/context-nat.md); bounds is the half-open [start end) the calendar clock reads, extent adds a range's, and utc-extent reads a time with a UTC offset or a ZonedDatetimeFn zone (docs/time.md). Every reader is pure and total, returning nil rather than throwing, because the structural genlCx producer calls it inside the settle/relabel loop.

Reads the time terms — a `DatetimeFn` reduced-precision ISO string, the calendar
constructors `YearFn` / `MonthFn` / `DayFn`, a `DatetimeRangeFn` range and the
`InstantFn` moment — to integer field vectors.  Field nesting is calendar containment
(`subinterval?`, docs/context-nat.md); `bounds` is the half-open `[start end)` the
calendar clock reads, `extent` adds a range's, and `utc-extent` reads a time with a UTC
offset or a `ZonedDatetimeFn` zone (docs/time.md).  Every reader is pure and total,
returning nil rather than throwing, because the structural genlCx producer calls it
inside the settle/relabel loop.
raw docstring

at-or-inside?clj

(at-or-inside? t [bs be])

True iff the moment t, six fields, lies in the half-open extent [bs be).

True iff the moment `t`, six fields, lies in the half-open extent `[bs be)`.
sourceraw docstring

boundsclj

(bounds form)

The half-open [start end) a calendar term lies between, each a six-field vector: the end is the first moment of the next term at the same precision. Nil for a term that is not a calendar one or names no moment.

The half-open `[start end)` a calendar term lies between, each a six-field vector: the
end is the first moment of the next term at the same precision.  Nil for a term that is
not a calendar one or names no moment.
sourceraw docstring

calendar-functionsclj

The structural calendar constructors, functor → field count, one integer per field, coarsest first: (YearFn 2000), (MonthFn 2000 1), (DayFn 2000 1 15).

The structural calendar constructors, `functor → field count`, one integer per field,
coarsest first: `(YearFn 2000)`, `(MonthFn 2000 1)`, `(DayFn 2000 1 15)`.
sourceraw docstring

calendar-term?clj

(calendar-term? form)

True iff form is a well-formed calendar term — (YearFn 2000), (MonthFn 2000 1) or (DayFn 2000 1 15).

True iff `form` is a well-formed calendar term — `(YearFn 2000)`, `(MonthFn 2000 1)` or
`(DayFn 2000 1 15)`.
sourceraw docstring

containing-termsclj

(containing-terms t)

The terms in no zone that subinterval? or instant-within? can answer contain the time t in no zone, t among them and a DatetimeRangeFn range excepted: for each prefix of a calendar term's own fields, or of the start of an InstantFn moment or a range, the DatetimeFn term in every spelling (spellings) and the calendar term of as many fields. Nil for any other term.

The terms in no zone that `subinterval?` or `instant-within?` can answer contain the
time `t` in no zone, `t` among them and a `DatetimeRangeFn` range excepted: for each
prefix of a calendar term's own fields, or of the start of an `InstantFn` moment or a
range, the `DatetimeFn` term in every spelling (`spellings`) and the calendar term of
as many fields.  Nil for any other term.
sourceraw docstring

datetime-functionclj

The structural ISO constructor this namespace reads.

The structural ISO constructor this namespace reads.
sourceraw docstring

datetime-term?clj

(datetime-term? form)

True iff form is a (DatetimeFn "<iso>") term with a parseable ISO string.

True iff `form` is a `(DatetimeFn "<iso>")` term with a parseable ISO string.
sourceraw docstring

epoch-secondclj

(epoch-second fields)

The seconds from 1970-01-01T00:00:00 to the moment six fields name, both read on one clock, or nil when the calendar has no such moment.

The seconds from 1970-01-01T00:00:00 to the moment six fields name, both read on one
clock, or nil when the calendar has no such moment.
sourceraw docstring

extentclj

(extent form)

The half-open wall-clock [start end) a time interval term in no zone lies between: a calendar term's bounds, or a DatetimeRangeFn range's. Nil for any other term.

The half-open wall-clock `[start end)` a time interval term in no zone lies between: a
calendar term's `bounds`, or a `DatetimeRangeFn` range's.  Nil for any other term.
sourceraw docstring

instant-fieldsclj

(instant-fields form)

The six fields of an (InstantFn Y M D h m s) term, or nil for anything that is not one — a term of the wrong arity, a field out of range, or a date the calendar does not have.

The six fields of an `(InstantFn Y M D h m s)` term, or nil for anything that is not
one — a term of the wrong arity, a field out of range, or a date the calendar does not
have.
sourceraw docstring

instant-functionclj

The structural constructor for a moment, six integer fields always: (InstantFn 2000 1 1 0 0 0) is midnight at the start of 2000.

The structural constructor for a moment, six integer fields always:
`(InstantFn 2000 1 1 0 0 0)` is midnight at the start of 2000.
sourceraw docstring

instant-termclj

(instant-term fields)

The (InstantFn …) term six fields name, a PersistentList as sentex/canon normalizes a typed one to.

The `(InstantFn …)` term six fields name, a `PersistentList` as `sentex/canon`
normalizes a typed one to.
sourceraw docstring

instant-term?clj

(instant-term? form)

True iff form is a well-formed (InstantFn …) term.

True iff `form` is a well-formed `(InstantFn …)` term.
sourceraw docstring

instant-within?clj

(instant-within? a b)

True iff a is an InstantFn moment at or inside the interval term b's extent, or the same moment as the InstantFn term b. false otherwise, two intervals included: those are subinterval?'s.

True iff `a` is an `InstantFn` moment at or inside the interval term `b`'s extent, or
the same moment as the `InstantFn` term `b`.  `false` otherwise, two intervals
included: those are `subinterval?`'s.
sourceraw docstring

order-comparatorsclj

The registered pure comparators of an order, {relation → (fn [a b] a-below-b?)}. Each reads two terms' shape with no store read and no proof, and is total, returning false for terms it does not apply to. subtimeOf's answers the pairs whose lower term is a moment and leaves two intervals to subintervalOf's. context-nat reads one to order two context NATs, and the canonicalizer reads one to absorb a meet's argument (res/meet-order).

The registered pure comparators of an order, `{relation → (fn [a b] a-below-b?)}`.
Each reads two terms' shape with no store read and no proof, and is total, returning
`false` for terms it does not apply to.  `subtimeOf`'s answers the pairs whose lower
term is a moment and leaves two intervals to `subintervalOf`'s.  `context-nat` reads one
to order two context NATs, and the canonicalizer reads one to absorb a meet's argument
(`res/meet-order`).
sourceraw docstring

paired-extentsclj

(paired-extents a b)

[extent-a extent-b] read in one frame, both in no zone or both absolute, or nil: a wall-clock time in no zone and an absolute one have no order.

`[extent-a extent-b]` read in one frame, both in no zone or both absolute, or nil: a
wall-clock time in no zone and an absolute one have no order.
sourceraw docstring

range-functionclj

The structural constructor of a range, two ISO strings: (DatetimeRangeFn "2000-01" "2000-06") begins when its first string's interval begins and ends when its second's ends.

The structural constructor of a range, two ISO strings: `(DatetimeRangeFn "2000-01"
"2000-06")` begins when its first string's interval begins and ends when its second's
ends.
sourceraw docstring

subinterval?clj

(subinterval? a b)

True iff time term a denotes an interval contained in b's (reflexive): for two calendar or ISO terms in no zone, b's fields are a prefix of a's; else a's extent lies inside b's in one frame (paired-extents). false for anything else.

True iff time term `a` denotes an interval contained in `b`'s (reflexive): for two
calendar or ISO terms in no zone, `b`'s fields are a prefix of `a`'s; else `a`'s extent
lies inside `b`'s in one frame (`paired-extents`).  `false` for anything else.
sourceraw docstring

time-term?clj

(time-term? form)

True iff form is any term this namespace reads — a calendar constructor, a DatetimeFn string, a DatetimeRangeFn range, or an InstantFn moment. The test behind provers/shadowing-channels' :calendar.

True iff `form` is any term this namespace reads — a calendar constructor, a
`DatetimeFn` string, a `DatetimeRangeFn` range, or an `InstantFn` moment.  The test
behind `provers/shadowing-channels`' `:calendar`.
sourceraw docstring

utc-extentclj

(utc-extent form)

The half-open UTC [start end) of a term with a UTC offset or a named zone, a range of two such strings included; nil for a term in no zone.

The half-open UTC `[start end)` of a term with a UTC offset or a named zone, a range of
two such strings included; nil for a term in no zone.
sourceraw docstring

within?clj

(within? [as ae] [bs be])

True iff the half-open extent [as ae) lies inside [bs be), each bound a six-field vector.

True iff the half-open extent `[as ae)` lies inside `[bs be)`, each bound a six-field
vector.
sourceraw docstring

zoned-functionclj

The structural constructor of a wall-clock time in a named zone: (ZonedDatetimeFn "2000-03-26T00:30" "Europe/London").

The structural constructor of a wall-clock time in a named zone: `(ZonedDatetimeFn
"2000-03-26T00:30" "Europe/London")`.
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