Automattic / Automattic/jetpack
Contact form Date picker does not work properly for custom format jS F Y
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
I tried the Date picker block. When I clicked on the required date it was displayed as `1S February 2019`.
It appears that the date picker can't handle the custom format `jS F Y`.
where S represents the English ordinal suffix for the day of the month, 2 characters
e.g. st, nd, rd, th.
#### Steps to reproduce the issue
1. Set custom date format to `jS F Y`
2. Add a Date picker to a Contact Form on a post
3. View the post
4. Click on the required date
5. See the unexpected S in the date `1S February 2019`
#### What I expected
1st February 2019
#### What happened instead
1S February 2019
**Screenshots**

If applicable, add screenshots to help explain your problem.
Contributor guide
Research direction
Start by reproducing the issue in the Contact form Date picker block with the custom format `jS F Y`, following the listed steps. Trace how the picker formats the selected date and verify that the displayed result uses the expected ordinal suffix, `1st February 2019`, rather than `1S February 2019`.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php, wordpress
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100