#7056 closed defect (bug) (reported-upstream)
Incorrect date formatting
Reported by: | xavivars | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Make (Get Involved) / P2 | Keywords: | |
Cc: |
Description
On the "teams" sites, dates are not correctly formatted (see attachment).
It seems escaped characters are not properly handled
Attachments (1)
Change History (6)
#2
@
15 months ago
When I reported it, it was incorrect here:
But now, instead of the date, on each message you see how long it was created...
#3
@
15 months ago
Actually, it's still incorrect on desktop, but it seems on mobile display there's a compact visualization mode that is correct.
#4
@
15 months ago
- Resolution set to reported-upstream
- Status changed from new to closed
It seems this is coming from the date_format
being set to j \d\e F \d\e Y
(This is likely coming from a GlotPress translated string)
That's then escaped to "dateFormat":"j \\d\\e F \\d\\e Y"
when output as part of o2
settings, and it's then converted over to Moment.js date format in https://github.com/Automattic/o2/blob/master/js/utils/timestamp.js
It looks like the above o2 code doesn't handle escaped characters. I've filed an upstream issue: https://github.com/Automattic/o2/issues/226
screenshot