Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The DateTime component incorrectly restricts years #13579

Closed
pento opened this issue Jan 29, 2019 · 0 comments
Closed

The DateTime component incorrectly restricts years #13579

pento opened this issue Jan 29, 2019 · 0 comments
Labels
[Package] Components /packages/components [Type] Bug An existing feature does not function as intended

Comments

@pento
Copy link
Member

pento commented Jan 29, 2019

Describe the bug

The DateTime component restricts years to between 1970 and 9999. It shouldn't do that.

To Reproduce

  1. Create a new post
  2. Change the publication year to 1950.

Expected behavior

The year is changed to 1950.

Additional context

Core Ticket: https://core.trac.wordpress.org/ticket/46139

@pento pento added [Type] Bug An existing feature does not function as intended [Package] Components /packages/components labels Jan 29, 2019
jorgefilipecosta added a commit that referenced this issue Feb 4, 2019
## Description
Fixes: #13579

This PR changes the DateTime component to allow years between 0 and 1970 that were previously unallowed.
The classic editor allows this set of years so we are updating the component to be equivalent.
Years lower than 0 and greater than 9999 are not allowed because JS error happens inside moment functions if these years are used. The classic editor and the quick edit form also don't allow this set of years.

## How has this been tested?
I checked I'm able to use years between  0 and 1970 on the publish date field with success
youknowriad pushed a commit that referenced this issue Mar 6, 2019
## Description
Fixes: #13579

This PR changes the DateTime component to allow years between 0 and 1970 that were previously unallowed.
The classic editor allows this set of years so we are updating the component to be equivalent.
Years lower than 0 and greater than 9999 are not allowed because JS error happens inside moment functions if these years are used. The classic editor and the quick edit form also don't allow this set of years.

## How has this been tested?
I checked I'm able to use years between  0 and 1970 on the publish date field with success
youknowriad pushed a commit that referenced this issue Mar 6, 2019
## Description
Fixes: #13579

This PR changes the DateTime component to allow years between 0 and 1970 that were previously unallowed.
The classic editor allows this set of years so we are updating the component to be equivalent.
Years lower than 0 and greater than 9999 are not allowed because JS error happens inside moment functions if these years are used. The classic editor and the quick edit form also don't allow this set of years.

## How has this been tested?
I checked I'm able to use years between  0 and 1970 on the publish date field with success
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

1 participant