WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#46596 new defect (bug)

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

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

Description

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 2 years ago.
preview of the day suffix being displayed in the customizer
46596.diff (950 bytes) - added by dlh 2 years ago.

Download all attachments as: .zip

Change History (3)

@F.Ilona
2 years ago

preview of the day suffix being displayed in the customizer

@dlh
2 years ago

#1 @dlh
2 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.