Automattic / Automattic/jetpack

Contact form Date picker does not work properly for custom format jS F Y

Open
#11,251 9 comments 0 reactions 0 assignees View on GitHub
[Feature] Forms [Focus] Blocks [Focus] i18n [Pri] Normal Bug Customer Report [LEGACY]
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**
![image](https://user-images.githubusercontent.com/2474435/52166240-a13c1d00-2702-11e9-9159-5c97ceef7e9a.png)

If applicable, add screenshots to help explain your problem.

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.