Closed Bug 1437073 Opened 6 years ago Closed 6 years ago

Change aboutTelemetry ping picker date format to ISO 8601

Categories

(Toolkit :: Telemetry, enhancement, P3)

enhancement

Tracking

()

RESOLVED WONTFIX

People

(Reporter: chutten, Assigned: vivek3zero, Mentored)

Details

(Whiteboard: [good first bug][lang=js])

Attachments

(1 file)

At the beginning of the months in the beginning of the year, the ping picker in aboutTelemetry has dates like

2/1/2018

Which are ambiguous to anyone not living in the US, the Federated States of Micronesia, or the Marshall Islands.

This is because it formats to the installed locale of Firefox, which defaults to en-US.

Given about:telemetry's technical and international audience, I think we should format the date string as ISO 8601 (YYYY-MM-DD). This will have the added benefit of agreeing with the date string formats used inside the ping payloads themselves.

To help Mozilla out with this bug, here's the steps:

0) Comment here on the bug that you want to volunteer to help. I (or someone else) will assign it to you.
1) Download and build the Firefox source code: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build
- If you have any problems, please ask on IRC (https://wiki.mozilla.org/Irc) in the #introduction channel. They're there to help you get started.
- You can also read the Developer Guide, which has answers to most development questions: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Introduction
2) Start working on this bug. You will be editing toolkit/content/aboutTelemetry.js to no longer use Services.intl.DateTimeFormat to format the date and time string according to the Firefox locale, but to instead use the ISO 8601 format.
- If you have any problems with this bug, please comment on this bug and set the needinfo flag for me. Also, you can find me and my teammates on the #telemetry channel on IRC (https://wiki.mozilla.org/Irc) most hours of most days.
3) Build your change with `mach build` and use `mach lint` to make sure your change adheres to our style guide. To test your change, use `mach run` and navigate to `about:telemetry` to check to see if the ping picker (in the top-left, after you select 'Archived Pings') is using the new format.
4) Submit the patch for review. Mark me as a reviewer so I'll get an email to come look at your code.
- Here's the guide: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/How_to_Submit_a_Patch
5) After a series of reviews and changes to your patch, I'll mark it for checkin or push it to autoland. Your code will soon be shipping to Firefox users worldwide!
6) ...now you get to think about what kind of bug you'd like to work on next. Let me know what you're interested in and I can help you find your next contribution.
Hey,
Can you assign me this bug? I already started working on it. 

Thanks,
Ash
Sure, done!
Assignee: nobody → theashwinpatil
Mentor: chutten
How are things coming along? Anything I can help with?
Flags: needinfo?(theashwinpatil)
Assignee: theashwinpatil → nobody
Flags: needinfo?(theashwinpatil)
I've submitted an initial patch. Please let me know if I went about doing this the right away or not. Thanks!
Comment on attachment 8959655 [details]
Bug 1437073 - Change aboutTelemetry ping picker date format to ISO 8601

https://reviewboard.mozilla.org/r/228480/#review234330

Looks good from the date point of view, but by manually creating the time string we will fail to localise properly for languages that use a different time separator, or put the time before the date.

...now that I look more closely at the problem, it may not be simple to rewrite this in ISO8601 for just the date part. We either have to go full ISO8601 using Date.prototype.toISOString() or we have to surrender to the user's locale using DateTimeFormat.

toISOString doesn't let us tell it we want the local timezone and a 12-hour format.

DateTimeFormat doesn't let use specify the order of YYYY-mm-dd.

I think it might be best to close this bug as WONTFIX. It was a simple idea, but the implementation looks to be far too complicated to be worth the effort.

What do you think?
Attachment #8959655 - Flags: review?(chutten) → review-
I agree. I didn't account for languages which have time before date or use different time separators. 
There is Date.prototype.toLocaleString() but this won't guarantee ISO 8601 format.
There is also Date.prototype.toLocaleTimeString() for time but using this along with toISOString for date won't account for cases where time comes before date.
Shall we call this WONTFIX and find you something else to work on, then?
Assignee: nobody → vivek3zero
Status: NEW → ASSIGNED
Flags: needinfo?(vivek3zero)
Do let me know if you'd like some help finding something new to work on.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Flags: needinfo?(vivek3zero)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: