aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/time/date.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/time/date.lux')
-rw-r--r--stdlib/source/library/lux/time/date.lux50
1 files changed, 25 insertions, 25 deletions
diff --git a/stdlib/source/library/lux/time/date.lux b/stdlib/source/library/lux/time/date.lux
index 75e5609ea..d06910711 100644
--- a/stdlib/source/library/lux/time/date.lux
+++ b/stdlib/source/library/lux/time/date.lux
@@ -95,7 +95,7 @@
(template [<name> <type> <field>]
[(def: .public <name>
(-> Date <type>)
- (|>> :representation (get@ <field>)))]
+ (|>> :representation (value@ <field>)))]
[year Year #year]
[month Month #month]
@@ -109,13 +109,13 @@
(let [reference (:representation reference)
sample (:representation sample)]
(and (\ //year.equivalence =
- (get@ #year reference)
- (get@ #year sample))
+ (value@ #year reference)
+ (value@ #year sample))
(\ //month.equivalence =
- (get@ #month reference)
- (get@ #month sample))
- (n.= (get@ #day reference)
- (get@ #day sample))))))
+ (value@ #month reference)
+ (value@ #month sample))
+ (n.= (value@ #day reference)
+ (value@ #day sample))))))
(implementation: .public order
(Order Date)
@@ -126,19 +126,19 @@
(let [reference (:representation reference)
sample (:representation sample)]
(or (\ //year.order <
- (get@ #year reference)
- (get@ #year sample))
+ (value@ #year reference)
+ (value@ #year sample))
(and (\ //year.equivalence =
- (get@ #year reference)
- (get@ #year sample))
+ (value@ #year reference)
+ (value@ #year sample))
(or (\ //month.order <
- (get@ #month reference)
- (get@ #month sample))
+ (value@ #month reference)
+ (value@ #month sample))
(and (\ //month.order =
- (get@ #month reference)
- (get@ #month sample))
- (n.< (get@ #day reference)
- (get@ #day sample)))))))))
+ (value@ #month reference)
+ (value@ #month sample))
+ (n.< (value@ #day reference)
+ (value@ #day sample)))))))))
)
(def: section_parser
@@ -271,17 +271,17 @@
..civil_month)))
(def: last_era_leap_day
- (.int (dec ..days_per_leap)))
+ (.int (-- ..days_per_leap)))
(def: last_era_day
- (.int (dec ..days_per_era)))
+ (.int (-- ..days_per_era)))
(def: (civil_year utc_month utc_year)
(-> Nat Year Int)
(let [... Coercing, because the year is already in external form.
utc_year (:as Int utc_year)]
(if (n.< ..first_month_of_civil_year utc_month)
- (dec utc_year)
+ (-- utc_year)
utc_year)))
... http://howardhinnant.github.io/date_algorithms.html
@@ -290,7 +290,7 @@
(let [utc_month (|> date ..month //month.number)
civil_year (..civil_year utc_month (..year date))
era (|> (if (i.< +0 civil_year)
- (i.- (.int (dec //year.era))
+ (i.- (.int (-- //year.era))
civil_year)
civil_year)
(i./ (.int //year.era)))
@@ -299,7 +299,7 @@
civil_year)
day_of_year (|> utc_month
..day_of_year_from_month
- (i.+ (.int (dec (..day_of_month date)))))
+ (i.+ (.int (-- (..day_of_month date)))))
day_of_era (|> day_of_year
(i.+ (i.* (.int //year.days) year_of_era))
(i.+ (i./ (.int //year.leap) year_of_era))
@@ -334,7 +334,7 @@
(i.+ +1)
.nat)
year (if (n.< ..first_month_of_civil_year month)
- (inc year)
+ (++ year)
year)]
... Coercing, because the year is already in internal form.
(try.trusted
@@ -348,7 +348,7 @@
(def: &order ..order)
(def: succ
- (|>> ..days inc ..of_days))
+ (|>> ..days ++ ..of_days))
(def: pred
- (|>> ..days dec ..of_days)))
+ (|>> ..days -- ..of_days)))