Making WordPress.org

Opened 6 months ago

Closed 6 months ago

Last modified 6 months ago

#7056 closed defect (bug) (reported-upstream)

Incorrect date formatting

Reported by: xavivars's profile 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)

SCR-20230613-hjl.png (8.8 KB) - added by xavivars 6 months ago.
screenshot

Download all attachments as: .zip

Change History (6)

@xavivars
6 months ago

screenshot

#1 @dd32
6 months ago

Hi @xavivars Can you link to where this is occuring?

#2 @xavivars
6 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 @xavivars
6 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 @dd32
6 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

#5 @dd32
6 months ago

Took it upstream, but it should now be fixed too.

Note: See TracTickets for help on using tickets.