(*find-year* value)
Finds a year for given value. Returns {:year x :seconds x} for given value where seconds is number of seconds of start of the year relative to unix-epoch-year
Finds a year for given value. Returns {:year x :seconds x} for given value where seconds is number of seconds of start of the year relative to unix-epoch-year
This variable is supposed to be used through with-time-configuration macro. Specify function that calculates if given day-context is holiday or not. Look @ "day-context" Returns boolean
This variable is supposed to be used through with-time-configuration macro. Specify function that calculates if given day-context is holiday or not. Look @ "day-context" Returns boolean
Variable that is used in function get-offset. ->local, <-local and day? funcitons are affected when changing value of this variable. I.E. (binding [offset -60] ...) would make all computations in that time zone.
Variable that is used in function get-offset. ->local, <-local and day? funcitons are affected when changing value of this variable. I.E. (binding [*offset* -60] ...) would make all computations in that time zone.
This variable can be used to customize weekend? function to return true or false for day-context. Function should accept one argument that is supposed to be day [1-7] and return true or false.
This variable can be used to customize weekend? function to return true or false for day-context. Function should accept one argument that is supposed to be day [1-7] and return true or false.
Returns sequence of days for given value that are contained in that frame-type. List is consisted of keys:
:value :day :week :month :day-in-month :weekend? :holiday? :first-day-in-month? :last-day-in-month?
for Gregorian calendar. Frame types can be extened by implementing different calendar-frame functions. Vura supports calendar-frames for:
Returns sequence of days for given value that are contained in that frame-type. List is consisted of keys: :value :day :week :month :day-in-month :weekend? :holiday? :first-day-in-month? :last-day-in-month? for Gregorian calendar. Frame types can be extened by implementing different calendar-frame functions. Vura supports calendar-frames for: * year * month * week
(date)
(date year)
(date year month)
(date year month day)
(date year month day hour)
(date year month day hour minute)
(date year month day hour minute second)
(date year month day' hour' minute' second' millisecond')
Constructs new Date object. Months: 1-12 Days: 1-7 (1 is Monday)
Constructs new Date object. Months: 1-12 Days: 1-7 (1 is Monday)
(date->value t)
Returns value of Date instance in seconds. Value is localized to offset
Returns value of Date instance in seconds. Value is localized to offset
(day-context value)
Returns day context for given value in Gregorian calendar.
Returnes hash-map with keys: :value :day :week :month :year :day-in-month :weekend? :holiday? :first-day-in-month? :last-day-in-month?
Returns day context for given value in Gregorian calendar. Returnes hash-map with keys: :value :day :week :month :year :day-in-month :weekend? :holiday? :first-day-in-month? :last-day-in-month?
(day-in-month? value)
Returns which day (Gregorian) in month input value belongs to. For example for date 15.02.2015 it will return number 15
Returns which day (Gregorian) in month input value belongs to. For example for date 15.02.2015 it will return number 15
(day-in-year? value)
Returns day in year period (1 - 366)
Returns day in year period (1 - 366)
(day-time-context value)
Composition of time-context and day-context
Composition of time-context and day-context
(day? value)
Returns which day in week does input value belongs to. For example for date 15.02.2015 it will return number 7
Returns which day in week does input value belongs to. For example for date 15.02.2015 it will return number 7
(days n)
Function returns value of n days as number.
Function returns value of n days as number.
(days-in-month month leap-year?)
Mapping for months. Returns how much are there for input month according to Gregorian calendar.
Mapping for months. Returns how much are there for input month according to Gregorian calendar.
(first-day-in-month month)
(first-day-in-month month leap-year?)
Returns first day for given month in range of days 1-366 for leap-year?
Returns first day for given month in range of days 1-366 for leap-year?
(first-day-in-month? value)
Returns true if value in seconds belongs to first day in month.
Returns true if value in seconds belongs to first day in month.
Definition of future years. Lazy sequence of all future years from unix-epoch-year according to Gregorian calendar
Definition of future years. Lazy sequence of all future years from unix-epoch-year according to Gregorian calendar
(get-offset date)
Funciton returns time zone for input Date object
Funciton returns time zone for input Date object
(hour? value)
Returns which hour in day does input value belongs to. For example for date 15.02.2015 it will return number 0
Returns which hour in day does input value belongs to. For example for date 15.02.2015 it will return number 0
(hours n)
Function returns value of n hours as number.
Function returns value of n hours as number.
(interval start end)
Returns period of time value in milliseconds between start and end. Input values are supposed to be Date.
Returns period of time value in milliseconds between start and end. Input values are supposed to be Date.
(intervals & timestamps)
Given sequence of timestamps (Date) values returns period values between each timestamp value in milliseconds
Given sequence of timestamps (Date) values returns period values between each timestamp value in milliseconds
(last-day-in-month? value)
Returns true if value in seconds belongs to last day in month.
Returns true if value in seconds belongs to last day in month.
Year day to month mapping calculated during compilation with year-day-mapping function for leap year.
Year day to month mapping calculated during compilation with year-day-mapping function for leap year.
(leap-year? year)
Calculates if date value belongs to year that is defined as leap year.
Calculates if date value belongs to year that is defined as leap year.
(midnight value)
Function calculates value of midnight for given value. For example if some date value is inputed it will round-number to the begining of that day.
Function calculates value of midnight for given value. For example if some date value is inputed it will round-number to the begining of that day.
(millisecond? value)
Returns which millisecond in day does input value belongs to. For example for date 15.02.2015 it will return number 0
Returns which millisecond in day does input value belongs to. For example for date 15.02.2015 it will return number 0
(minute? value)
Returns which hour in day does input value belongs to. For example for date 15.02.2015 it will return number 0
Returns which hour in day does input value belongs to. For example for date 15.02.2015 it will return number 0
(minutes n)
Function returns value of n minutes as number.
Function returns value of n minutes as number.
(month? value)
Returns which month (Gregorian) does input value belongs to. For example for date 15.02.2015 it will return number 2
Returns which month (Gregorian) does input value belongs to. For example for date 15.02.2015 it will return number 2
Year day to month mapping calculated during compilation with year-day-mapping function.
Year day to month mapping calculated during compilation with year-day-mapping function.
Definition of past years. Lazy sequence of all past years according to Gregorian calendar from unix-epoch-year
Definition of past years. Lazy sequence of all past years according to Gregorian calendar from unix-epoch-year
(period {:keys [weeks days hours seconds minutes milliseconds]
:or {weeks 0 days 0 hours 0 seconds 0 minutes 0 milliseconds 0}})
Returns number of seconds of all input arguments added together
Returns number of seconds of all input arguments added together
(period? value)
Returns duration of for input value in form of map with keys:
:weeks :days :hours :minutes :seconds :milliseconds
Returns duration of for input value in form of map with keys: :weeks :days :hours :minutes :seconds :milliseconds
(round-number number)
(round-number number target-number)
(round-number number target-number round-how?)
Function returns round number that is devidable by target-number. Rounding strategy can be specified in round-how? options:
:floor :ceil :up :down
Rounding number strategy is symetric to 0. This means that :ceil will round negative numbers to lower target-number. I.E (round-number -9.5 1 :ceil) would return -10. Rounding happens in absolute domain and sign is inserted afterwards.
Negative target-numbers are not supported. Can't reason about that yet.
Function returns round number that is devidable by target-number. Rounding strategy can be specified in round-how? options: :floor :ceil :up :down Rounding number strategy is symetric to 0. This means that :ceil will round negative numbers to lower target-number. I.E (round-number -9.5 1 :ceil) would return -10. Rounding happens in absolute domain and sign is inserted afterwards. Negative target-numbers are not supported. Can't reason about that yet.
(second? value)
Returns which second in day does input value belongs to. For example for date 15.02.2015 it will return number 0
Returns which second in day does input value belongs to. For example for date 15.02.2015 it will return number 0
(seconds n)
Function returns value of n seconds as number.
Function returns value of n seconds as number.
(time-as-value bindings & body)
bindings => [name (time->value x) ...]
Similar to let or binding. Casts al bound symbol values with function time->value. Then evaluates body.
bindings => [name (time->value x) ...] Similar to let or binding. Casts al bound symbol values with function time->value. Then evaluates body.
(time-context value)
Similar to day-context only for time values [millisecond, second, minute, hour]
Similar to day-context only for time values [millisecond, second, minute, hour]
(time->value this)
Return numeric value for given object.
Return numeric value for given object.
(value->time this)
Returns Date for given value.
Returns Date for given value.
(value->date value)
Returns Date instance for value in seconds for current. Function first transforms value to local offset value.
Returns Date instance for value in seconds for current. Function first transforms value to local *offset* value.
(week-in-year? value)
Returns which week in year does input value belongs to. For example for date 15.02.2015 it will return number 6
Returns which week in year does input value belongs to. For example for date 15.02.2015 it will return number 6
(weekend? value)
Returns true if value in seconds belongs to weekend-days
Returns true if value in seconds belongs to *weekend-days*
(weeks n)
Function returns value of n weeks as number.
Function returns value of n weeks as number.
(with-time-configuration
{:keys [offset holiday? weekend-days]
:or {weekend-days *weekend-days* holiday? (fn [_] false) offset nil}}
&
body)
Utility macro to put context frame on computation scope. Specify:
:holiday? - (fn [day-context] true | false) :offset - +/- number :weekend-days - (fn [number] true | false)
Utility macro to put context frame on computation scope. Specify: :holiday? - (fn [day-context] true | false) :offset - +/- number :weekend-days - (fn [number] true | false)
(year-day-mapping leap-year?)
Calculates day mapping. Keys are days values are months. Function will return map where keys are days in year from 1-36[56] and month as value for that day.
Calculates day mapping. Keys are days values are months. Function will return map where keys are days in year from 1-36[56] and month as value for that day.
(year? value)
For given value year? returns year that value belogs to.
For given value year? returns year that value belogs to.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close