WordPress.org

Make WordPress Core

Opened 7 months ago

Last modified 7 months 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:
PR Number:

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

Download all attachments as: .zip

Change History (3)

@F.Ilona
7 months ago

preview of the day suffix being displayed in the customizer

@dlh
7 months ago

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