diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/time/date.lux | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/stdlib/source/lux/time/date.lux b/stdlib/source/lux/time/date.lux index 0b40932ef..dfb7baf7e 100644 --- a/stdlib/source/lux/time/date.lux +++ b/stdlib/source/lux/time/date.lux @@ -12,7 +12,7 @@ [data ["." maybe] [number - ["." nat ("#@." decimal)] + ["n" nat ("#@." decimal)] ["i" int ("#@." decimal)]] ["." text ("#@." monoid)] [collection @@ -34,7 +34,7 @@ (:: //month.equivalence = (get@ #month reference) (get@ #month sample)) - (n/= (get@ #day reference) + (n.= (get@ #day reference) (get@ #day sample))))) (structure: #export order (Order Date) @@ -50,13 +50,13 @@ (and (:: //month.order = (get@ #month reference) (get@ #month sample)) - (n/< (get@ #day reference) + (n.< (get@ #day reference) (get@ #day sample)))))))) ## Based on this: https://stackoverflow.com/a/42936293/6823464 (def: (pad value) (-> Int Text) - (let [digits (nat@encode (.nat value))] + (let [digits (n@encode (.nat value))] (if (i.< +10 value) (text@compose "0" digits) digits))) @@ -66,7 +66,7 @@ ($_ text@compose (if (i.< +0 year) (i@encode year) - (nat@encode (.nat year))) + (n@encode (.nat year))) "-" (pad (|> month //month.number inc .int)) "-" (pad (|> day .inc .int)))) @@ -75,7 +75,7 @@ (Parser Int) (do p.monad [sign (p.maybe (l.this "-")) - raw-year (p.codec nat.decimal (l.many l.decimal)) + raw-year (p.codec n.decimal (l.many l.decimal)) #let [signum (case sign (#.Some _) -1 @@ -86,7 +86,7 @@ (def: lex-section (Parser Int) - (p@map .int (p.codec nat.decimal (l.exactly 2 l.decimal)))) + (p@map .int (p.codec n.decimal (l.exactly 2 l.decimal)))) (def: (leap-years year) (-> Int Int) |