A partial port of tick.core, but now backed by Temporal on js runtime.
If a function from tick is implemented in this ns then it works the same as the tick equivalent.
The reason that tick has been ported is that it is a popular date/time library. As well as having a different basis on JS runtimes, there are some philosophical differences between tick and tempo.
What is there to choose between tempo.tick and tempo?
tempo has no zero-arg 'now' functions. Similarly, there are no functions that make implicit use of
the 'current' or 'ambient' zone. For this reason, there is no with-clock
macro in tempo
tempo is sometimes more verbose - for example to get the year of an Instant for example first requires converting to a zdt by explicitly supplying a zone.
in tick the same function is used for parsing strings and accessing properties. For example in tick (t/date x)
will parse x if it is a string,
or access the date from x if it is e.g. a zdt.
tempo blocks non-commutative operations by default (e.g. 'adding' a month to a date)
Other differences:
A partial port of tick.core, but now backed by Temporal on js runtime. If a function from tick is implemented in this ns then it works the same as the tick equivalent. The reason that tick has been ported is that it is a popular date/time library. As well as having a different basis on JS runtimes, there are some philosophical differences between tick and tempo. What is there to choose between tempo.tick and tempo? 1. tempo has no zero-arg 'now' functions. Similarly, there are no functions that make implicit use of the 'current' or 'ambient' zone. For this reason, there is no `with-clock` macro in tempo 2. tempo is sometimes more verbose - for example to get the year of an Instant for example first requires converting to a zdt by explicitly supplying a zone. 3. in tick the same function is used for parsing strings and accessing properties. For example in tick `(t/date x)` will parse x if it is a string, or access the date from x if it is e.g. a zdt. 4. tempo blocks non-commutative operations by default (e.g. 'adding' a month to a date) Other differences: * Unlike tick, no entity for year or month exists in tempo - where needed, numbers are used to repsesent those * Entities for temporal-amounts are alpha - so not included here yet * No parsing or formatting of non-ISO strings - since this is not in Temporal * Although there is a timezone entity, functions that would accept or return a timezone instead accept or return a string * There are no offset-datetime or offset-time entities since they don't exist in Temporal.
(<< t n unit)
shift Temporal backward by n units
shift Temporal backward by n units
Same as clojure.core/>=, but works on dates, rather than numbers
Same as clojure.core/>=, but works on dates, rather than numbers
(>> t n unit)
shift Temporal forward by n units
shift Temporal forward by n units
(between v1 v2 unit)
the amount of unit between v1 and v2
the amount of unit between v1 and v2
(coincident? start end event)
for the 2-arity ver, Does containing-interval wholly contain the given contained-interval?
for the 3-arity, does the event lie within the span of time described by start and end
for the 2-arity ver, Does containing-interval wholly contain the given contained-interval? for the 3-arity, does the event lie within the span of time described by start and end
(current-clock)
(current-zone)
Return the current zone, which can be overridden by the clock dynamic var
Return the current zone, which can be overridden by the *clock* dynamic var
(date)
(date v)
(epoch)
Constant for the 1970-01-01T00:00:00Z epoch instant
Constant for the 1970-01-01T00:00:00Z epoch instant
(inst)
(max arg & args)
Find the latest of the given arguments. Callers should ensure that no argument is nil.
Find the latest of the given arguments. Callers should ensure that no argument is nil.
(min arg & args)
Find the earliest of the given arguments. Callers should ensure that no argument is nil.
Find the earliest of the given arguments. Callers should ensure that no argument is nil.
(new-date)
(new-date year month day-of-month)
(new-time)
(new-time hour minute)
(new-time hour minute second)
(new-year-month)
(new-year-month year month)
(truncate x u)
Returns a copy of x truncated to the specified unit.
Returns a copy of x truncated to the specified unit.
(with t fld new-value)
Adjust a temporal with an adjuster or field
Adjust a temporal with an adjuster or field
(zone)
(zoned-date-time? v)
true if v is a zoned-date-time?
true if v is a zoned-date-time?
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close