Makes tooltip, also makes date ranges work the way Ben asked for
This commit is contained in:
@@ -255,19 +255,22 @@
|
||||
(if date-range-value
|
||||
(-> (condp = date-range-value
|
||||
"week"
|
||||
(let [last-monday (coerce/to-date-time (atime/last-monday))]
|
||||
(let [last-monday (atime/as-local-time (coerce/to-date-time (atime/last-monday)))]
|
||||
(assoc m
|
||||
start-date-key (time/plus last-monday (time/days -7))
|
||||
end-date-key last-monday))
|
||||
end-date-key (time/plus last-monday (time/days -1))))
|
||||
|
||||
"month"
|
||||
(assoc m
|
||||
start-date-key (time/plus (time/now) (time/months -1))
|
||||
end-date-key nil)
|
||||
(let [end-of-month (atime/as-local-time (coerce/to-date-time (time/plus (time/first-day-of-the-month (atime/local-today)) (time/days -1))))]
|
||||
(assoc m
|
||||
start-date-key (time/first-day-of-the-month end-of-month)
|
||||
end-date-key end-of-month))
|
||||
|
||||
"year"
|
||||
(assoc m
|
||||
start-date-key (time/plus (time/now) (time/years -1))
|
||||
start-date-key (atime/as-local-time (time/date-time (time/year (atime/local-today))
|
||||
1
|
||||
1))
|
||||
end-date-key nil)
|
||||
|
||||
"all"
|
||||
|
||||
Reference in New Issue
Block a user