Contains functions to be exposed to library users.
Contains functions to be exposed to library users.
(readable-date date-string & opts-map)
Accepts date-string only in the form of DD-MM-YYYY
and YYYY-MM-DD
formats. DD
and MM
could just be D
or M
.
Returns a string similar to:
April 27, 2020
or Apr 27, 2020
or Monday, April 27, 2020
or Mon, April 27, 2020
or Mon, Apr 27, 2020
.
The optional options map dictates the return format. It includes the following keys:
:day-name?
- defaults to true
.:short-names?
- defaults to false
.Accepts date-string only in the form of `DD-MM-YYYY` and `YYYY-MM-DD` formats. `DD` and `MM` could just be `D` or `M`. Returns a string similar to: `April 27, 2020` or `Apr 27, 2020` or `Monday, April 27, 2020` or `Mon, April 27, 2020` or `Mon, Apr 27, 2020`. The optional options map dictates the return format. It includes the following keys: - `:day-name?` - defaults to `true`. - `:short-names?` - defaults to `false`.
(readable-duration {:keys [start end approximation-string]})
Accepts start
and end
values (strings) only in the form of DD-MM-YYYY
and YYYY-MM-DD
formats. DD
and MM
could just be D
or M
.
Returns a readable duration, but only in the highest unit, with lower bound of the value.
Example: if the duration is between 1 and 2 years (ex: 1 year 10 months), then it will return 1 year
.
Similarly, if the duration is between 10 to 11 months, then it will return 10 months
.
Takes an optional approximation-string
, defaults to about
.
Accepts `start` and `end` values (strings) only in the form of `DD-MM-YYYY` and `YYYY-MM-DD` formats. `DD` and `MM` could just be `D` or `M`. Returns a readable duration, but only in the highest unit, with lower bound of the value. Example: if the duration is between 1 and 2 years (ex: 1 year 10 months), then it will return `1 year`. Similarly, if the duration is between 10 to 11 months, then it will return `10 months`. Takes an optional `approximation-string`, defaults to `about`.
(readable-moment date-string & moement-desc-map)
Accepts date-string
only in the form of DD-MM-YYYY
and YYYY-MM-DD
formats. DD
and MM
could just be D
or M
.
Describes a moment in histry. Useful for one-time events.
Takes an optional moment descriptor map with the following keys:
:prefix
- defaults to Happened
.:suffix
- defaults to ago
.
One or both the keys may be provided in the map.Accepts `date-string` only in the form of `DD-MM-YYYY` and `YYYY-MM-DD` formats. `DD` and `MM` could just be `D` or `M`. Describes a moment in histry. Useful for one-time events. Takes an optional moment descriptor map with the following keys: - `:prefix` - defaults to `Happened`. - `:suffix` - defaults to `ago`. One or both the keys may be provided in the map.
(readable-period {:keys [start end period-desc]})
Accepts start
and end
values (strings) only in the form of DD-MM-YYYY
and YYYY-MM-DD
formats. DD
and MM
could just be D
or M
.
Takes an optional period description map with the following keys:
:start-desc
- defaults to 'Started'.:end-desc
- defaults to 'Ended'.:period-desc
- defaults to 'Went on for'.:approximation-string
- defaults to 'about'.:past-indicator
- defaults to 'ago'.:separator
- defaults to ' | '. Note that there are spaces before and after the separator.Accepts `start` and `end` values (strings) only in the form of `DD-MM-YYYY` and `YYYY-MM-DD` formats. `DD` and `MM` could just be `D` or `M`. Takes an optional period description map with the following keys: - `:start-desc` - defaults to 'Started'. - `:end-desc` - defaults to 'Ended'. - `:period-desc` - defaults to 'Went on for'. - `:approximation-string` - defaults to 'about'. - `:past-indicator` - defaults to 'ago'. - `:separator` - defaults to ' | '. Note that there are spaces before and after the separator.
(readable-year val)
Returns a human readable string based on the value of number-of-years (val). Currently, it uses the US counting system. Please refer: https://www.britannica.com/topic/large-numbers-1765137.
Returns a human readable string based on the value of number-of-years (val). Currently, it uses the US counting system. Please refer: https://www.britannica.com/topic/large-numbers-1765137.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close