(add-to-period p grain n)
Adds the given quantity of grain to the period
Adds the given quantity of grain to the period
(end {:keys [start grain end] :as t})
Returns the end instant of the time object
Returns the end *instant* of the time object
(intersect t1 t2)
With the special case of time grains, it's quite easy. Will need to generalize to intervals later. Returns nil if no intersection. The result grain is the smallest of the args grains.
With the special case of time grains, it's quite easy. Will need to generalize to intervals later. Returns nil if no intersection. The result grain is the smallest of the args grains.
(interval t1 t2)
Builds a time interval between start of t1 and start of t2. The grain is the smallest of the args.
Builds a time interval between start of t1 and *start* of t2. The grain is the smallest of the args.
(interval-start-end t1 t2)
Builds a time interval between start of t1 and end of t2. The grain is the smallest of the args.
Builds a time interval between start of t1 and *end* of t2. The grain is the smallest of the args.
(negative-period period)
Turn a period into its opposite sign
Turn a period into its opposite sign
(period grain n)
Creates a period object with the given grain and quantity (can be negative)
Creates a period object with the given grain and quantity (can be negative)
(period->duration period)
Convert a period into an amount of seconds. This is approximate, since for instance 1 month's duration in seconds depends on which month
Convert a period into an amount of seconds. This is approximate, since for instance 1 month's duration in seconds depends on which month
(period-grain period)
Returns the grain of the period (the finest of its grains)
Returns the grain of the period (the finest of its grains)
(plus tt grain n)
Add n grain to tt. Set the grain to the finest between tt's and the added one.
Add n grain to tt. Set the grain to the finest between tt's and the added one.
(plus-period tt period)
Adds the period to the time object. The resulting grain is the finest.
Adds the period to the time object. The resulting grain is the finest.
(round tt grain)
Rounds the time grain to the grain: all smaller grain fields set to 0. If applied to a true interval (with :end), it turns the interval into a grain time objects (rounds start, removes :end).
Rounds the time grain to the grain: all smaller grain fields set to 0. If applied to a true interval (with :end), it turns the interval into a grain time objects (rounds start, removes :end).
(starting-at-the-end-of tt)
Build a time that starts at the end of provided time, with same grain
Build a time that starts at the end of provided time, with same grain
(t timezone year)
(t timezone year month)
(t timezone year month day)
(t timezone year month day hour)
(t timezone year month day hour minute)
(t timezone year month day hour minute second)
(t grain timezone year month day hour minute second)
Builds a time object with timezone, start and grain. Timezone is actually extracted from the provided instant.
Builds a time object with timezone, start and grain. Timezone is actually extracted from the provided instant.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close