Liking cljdoc? Tell your friends :D

vura.core


*find-year*clj/s

(*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
raw docstring

*holiday?*clj/s

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
raw docstring

*offset*clj/s

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.
raw docstring

*weekend-days*clj/s

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.
raw docstring

calendar-frameclj/s

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
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
raw docstring

dateclj/s

(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)
raw docstring

date->valueclj/s

(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
raw docstring

dayclj/s

86400

86400
raw docstring

day-contextclj/s

(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?
raw docstring

day-in-month?clj/s

(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
raw docstring

day-in-year?clj/s

(day-in-year? value)

Returns day in year period (1 - 366)

Returns day in year period (1 - 366)
raw docstring

day-time-contextclj/s

(day-time-context value)

Composition of time-context and day-context

Composition of time-context and day-context
raw docstring

day?clj/s

(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
raw docstring

daysclj/s

(days n)

Function returns value of n days as number.

Function returns value of n days as number.
raw docstring

days-in-monthclj/s

(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.
raw docstring

first-day-in-monthclj/s

(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?
raw docstring

first-day-in-month?clj/s

(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.
raw docstring

future-yearsclj/s

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
raw docstring

get-offsetclj/s

(get-offset date)

Funciton returns time zone for input Date object

Funciton returns time zone for input Date object
raw docstring

hourclj/s

3600

3600
raw docstring

hour?clj/s

(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
raw docstring

hoursclj/s

(hours n)

Function returns value of n hours as number.

Function returns value of n hours as number.
raw docstring

intervalclj/s

(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.
raw docstring

intervalsclj/s

(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
raw docstring

last-day-in-month?clj/s

(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.
raw docstring

leap-year-day-mappingclj/s

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.
raw docstring

leap-year?clj/s

(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.
raw docstring

microsecondclj/s

1.0E-6

1.0E-6
raw docstring

midnightclj/s

(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.
raw docstring

millisecondclj/s

0.001

0.001
raw docstring

millisecond?clj/s

(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
raw docstring

minuteclj/s

60

60
raw docstring

minute?clj/s

(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
raw docstring

minutesclj/s

(minutes n)

Function returns value of n minutes as number.

Function returns value of n minutes as number.
raw docstring

month?clj/s

(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
raw docstring

nanosecondclj/s

1.0E-9

1.0E-9
raw docstring

normal-year-day-mappingclj/s

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.
raw docstring

past-yearsclj/s

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
raw docstring

periodclj/s

(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
raw docstring

period?clj/s

(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
raw docstring

round-numberclj/s

(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.
raw docstring

secondclj/s

1

1
raw docstring

second?clj/s

(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
raw docstring

secondsclj/s

(seconds n)

Function returns value of n seconds as number.

Function returns value of n seconds as number.
raw docstring

time-as-valueclj/smacro

(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.
raw docstring

time-contextclj/s

(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]
raw docstring

TimeValueProtocolclj/s≠protocol

time->valueclj/s

(time->value this)

Return numeric value for given object.

Return numeric value for given object.

value->timeclj/s

(value->time this)

Returns Date for given value.

Returns Date for given value.

value->dateclj/s

(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.
raw docstring

weekclj/s

604800

604800
raw docstring

week-in-year?clj/s

(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
raw docstring

weekend?clj/s

(weekend? value)

Returns true if value in seconds belongs to weekend-days

Returns true if value in seconds belongs to *weekend-days*
raw docstring

weeksclj/s

(weeks n)

Function returns value of n weeks as number.

Function returns value of n weeks as number.
raw docstring

with-time-configurationclj/smacro

(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)
raw docstring

year-day-mappingclj/s

(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.
raw docstring

year?clj/s

(year? value)

For given value year? returns year that value belogs to.

For given value year? returns year that value belogs to.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close