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

Fixes #114: Added a widget for datetime string format. #116

Merged
merged 2 commits into from
Apr 4, 2016

Conversation

n1k0
Copy link
Collaborator

@n1k0 n1k0 commented Apr 4, 2016

WiP. Refs #114 and #113. I've realized that the string JSONSchema type allows specifying a format property, which can be date-time. Previously, we were erroneously considering this value as a type, so this patch removes support for it as a type and moves its support as a format.

It also introduces a very basic input[type=datetime] widget which offers a specific UI on some platforms; by default, browsers not supporting it will render a simple text input. The good thing being the validator works in every situation when validating the value, which must follow the RFC 3339, section 5.6 format.

  • Implement
  • Test
  • Document
  • Add sample to the playground

Note: next steps will be to add support for more string formats (email, url, etc.) through #113.

@n1k0
Copy link
Collaborator Author

n1k0 commented Apr 4, 2016

r=? @magopian @leplatrem

onChange
}) {
return (
<input type="datetime"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the right type is datetime-local.
See https://developer.mozilla.org/en/docs/Web/HTML/Element/Input#Attributes and whatwg/html#336

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I'll update that.

@leplatrem
Copy link
Contributor

r+wc :)

@n1k0 n1k0 merged commit 7f2518d into master Apr 4, 2016
@n1k0 n1k0 deleted the 114-datetime-widget branch April 4, 2016 13:52
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

Successfully merging this pull request may close these issues.

2 participants