@tomhughes requested changes on this pull request.
> +
+ let cal = new CalHeatmap();
+ let currentTheme = getTheme();
+
+ function renderHeatmap() {
+ cal.destroy();
+ cal = new CalHeatmap();
+
+ cal.paint({
+ itemSelector: "#cal-heatmap",
+ theme: currentTheme,
+ domain: {
+ type: "month",
+ gutter: 4,
+ label: {
+ text: (timestamp) => I18n.strftime(new Date(2000, new
Date(timestamp).getMonth(), 15), "%b"),
If we've constructed a date from the timestamp why do you then extract the
month from that and build a new date? If the format only uses the month the
rest of the date doesn't matter?
It might a bit faster to just lookup `I18n.t("date.abbr_month_names")` once
before the paint call and then index that array with the month number rather
than calling strftime repeatedly - just beware of 0/1 based indexing!
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5402#pullrequestreview-2669390875
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/5402/review/2669390...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev