aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/time/date.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/time/date.lux16
1 files changed, 7 insertions, 9 deletions
diff --git a/stdlib/source/library/lux/time/date.lux b/stdlib/source/library/lux/time/date.lux
index dd2cae8de..7009c54eb 100644
--- a/stdlib/source/library/lux/time/date.lux
+++ b/stdlib/source/library/lux/time/date.lux
@@ -61,21 +61,21 @@
(-> Nat Text)
(let [digits (n\encoded value)]
(if (n.< 10 value)
- (text\compose "0" digits)
+ (text\composite "0" digits)
digits)))
(def: separator
"-")
(abstract: .public Date
- {#.doc (example "A date specified as a year/month/day triplet.")}
+ {}
- {#year Year
- #month Month
- #day Nat}
+ (Record
+ {#year Year
+ #month Month
+ #day Nat})
(def: .public (date year month day_of_month)
- {#.doc (example "A date, within the allowed limits.")}
(-> Year Month Nat (Try Date))
(if (..day_is_within_limits? year month day_of_month)
(#try.Success
@@ -184,14 +184,12 @@
(def: (format value)
(-> Date Text)
- ($_ text\compose
+ ($_ text\composite
(\ //year.codec encoded (..year value))
..separator (..padded (|> value ..month //month.number))
..separator (..padded (..day_of_month value))))
(implementation: .public codec
- {#.doc (example "Based on ISO 8601."
- "For example: 2017-01-15")}
(Codec Text Date)
(def: encoded ..format)