Skip to content
Snippets Groups Projects
Unverified Commit ee914e72 authored by Cam Saul's avatar Cam Saul Committed by GitHub
Browse files

core(pulse): fix year format (year-of-era vs week-based-year) (#11692)

Related Documentation of date format:
https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html



In pulse notification I found out (works since yesterday until
tonight) that a timetamp formatted by a Pulse would output "Dec 31,
2020" for today's date (instead of "Dec 31, 2019").
This is because of the confusion between "YYYY" (the week based year,
this week is the 1st week of 2020) and "yyyy" formatting (the era
based year - thus the commonly expected year for a single day format).

Co-authored-by: default avatarPaul B. <paul+gh@bonaud.fr>
parent bb235057
No related branches found
No related tags found
No related merge requests found
......@@ -19,10 +19,10 @@
[timezone-id s col]
(case (:unit col)
;; these types have special formatting
:hour (reformat-temporal-str timezone-id s "h a - MMM YYYY")
:hour (reformat-temporal-str timezone-id s "h a - MMM yyyy")
:week (str "Week " (reformat-temporal-str timezone-id s "w - YYYY"))
:month (reformat-temporal-str timezone-id s "MMMM YYYY")
:quarter (reformat-temporal-str timezone-id s "QQQ - YYYY")
:month (reformat-temporal-str timezone-id s "MMMM yyyy")
:quarter (reformat-temporal-str timezone-id s "QQQ - yyyy")
;; no special formatting here : return as ISO-8601
;; TODO: probably shouldn't even be showing sparkline for x-of-y groupings?
......@@ -30,7 +30,7 @@
s
;; for everything else return in this format
(reformat-temporal-str timezone-id s "MMM d, YYYY")))
(reformat-temporal-str timezone-id s "MMM d, yyyy")))
(def ^:private RenderableInterval
{:interval-start Temporal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment