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

Can't use Datetime parseFormat without time zone token #4976

Open
ontanj opened this issue Nov 22, 2019 · 0 comments
Open

Can't use Datetime parseFormat without time zone token #4976

ontanj opened this issue Nov 22, 2019 · 0 comments

Comments

@ontanj
Copy link

ontanj commented Nov 22, 2019

From what I find the time zone is unconditionally appended to the Datetime string before parsing with Moment. This yields all Datetime parseFormats that lack the trailing 'Z' ineffective. Including 5 from the default list.

Behavior

In Model:

Event.add({
  [...]
  date: { type: Types.Datetime, parseFormat: ['YYYY-MM-DD hh:mm'], required: true, initial: true}
  [...]
})

Setting "2019-11-22 17:30" through Admin UI should be valid.

Currently that's invalid, while setting parseFormat: ['YYYY-MM-DD hh:mm Z'] makes the string "2019-11-22 17:30" valid in Admin UI.

Environment

Software Version
Keystone 4.2.1
Node.js 10.16.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant