[openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)
Anton Khorev
notifications at github.com
Tue Jan 21 04:35:39 UTC 2025
@AntonKhorev commented on this pull request.
> + const jsDate = new Date(date);
+ const translations = I18n.translations[locale] || I18n.translations.en;
+ const dateTranslations = translations && translations.date;
+ const monthNames = dateTranslations && dateTranslations.month_names;
+
+ const months = monthNames || [];
+ const monthName = months[jsDate.getMonth() + 1] || `${jsDate.getMonth + 1}.`;
+ const day = jsDate.getDate();
+ const year = jsDate.getFullYear();
+
+ const localizedDate = `${day}. ${monthName} ${year}.`;
```suggestion
const localizedDate = I18n.l("date.formats.long", date);
```
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5402#pullrequestreview-2563457038
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5402/review/2563457038 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250120/66fe0eeb/attachment.htm>
More information about the rails-dev
mailing list