MetaBrainz Foundation

Fix date formatting across the BookBrainz user interface

Aim: convert all dates and times in the BookBrainz UI to ISO format Estimated time: 3 hours

When we began using JavaScript for the BookBrainz site code, all rendering of dates was done on the server side, resulting in a consistent output format for each date.

However, since we began rendering the site using React, some of the components are rendered client side. Whenever locale-specific formats are used, the output will depend on the browser locale setting, which is unpredictable. On top of this, if the server locale changes, the date format may also be different. As a result, we'd like to rewrite all date rendering to use a single consistent format.

This task consists of going through all the React and Pug templates in the site, and identifying places where dates are rendered. The Moment.js library should then be used to format each date using ISO format (with the 'T' date/time separate replaced with a space for readability). Please keep the same level of detail for dates and times - if only a date is rendered currently, use "YYYY-MM-DD" format, and if both a date and time are provided, used "YYYY-MM-DD HH:MM:SS" format.

To submit your work, clone the repository on GitHub and locally, create a git branch for your work, prefixed "consistent-dates-" and ending in your GCI username. Commit your modifications, using small commits which make clear, self-contained changes. Finally, push your work to GitHub, and create a new PR with the changes.

Task tags

  • react
  • consistent
  • bookbrainz
  • javascript
  • moment.js

Students who completed this task

Daniel Hsing

Task type

  • code Code
  • web Design
close

2016