Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#46596 new defect (bug)

WP_Customize_Date_Time_Control class - date format ignores day of the month suffix (S)

Reported by: filona's profile F.Ilona Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7
Component: Customize Keywords: has-patch needs-testing
Focuses: Cc:


When adding a date time control to the customizer using the WP_Customize_Date_Time_Control class with the add_control() method, the character for the day of the month suffix (S) is not replaced/stripped when formatting the date and gets displayed in the customizer.

See attached image.

Like other date formatting characters, the suffix should either be replaced with the get_option( 'date_format' ) value or be removed completely.

Attachments (2)

Date_Time_customizer_date_format_ignored.png (6.0 KB) - added by F.Ilona 5 years ago.
preview of the day suffix being displayed in the customizer
46596.diff (950 bytes) - added by dlh 5 years ago.

Download all attachments as: .zip

Change History (3)

5 years ago

preview of the day suffix being displayed in the customizer

5 years ago

#1 @dlh
5 years ago

  • Keywords has-patch needs-testing added
  • Version changed from 5.1 to 4.7

Hi @filona, and welcome to WordPress Trac! Thanks for submitting this report.

46596.diff would add some special handling to WP_Customize_Date_Time_Control for a date_format with jS. Are you able to test the patch against your use case?

Note: See TracTickets for help on using tickets.