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

[form-builder] [schema] Add datetime type with default input #275

Merged
merged 17 commits into from
Oct 19, 2017

Conversation

thomax
Copy link
Contributor

@thomax thomax commented Oct 13, 2017

No description provided.

@bjoerge
Copy link
Member

bjoerge commented Oct 18, 2017

I think this is ready to ship now.

  • Renamed the date type to datetime, so that we can introduce both a date and a time type later on.
  • Moved the simple date input over to the @sanity/form-builder package. Its now bundled by default and used for type: 'datetime' schema types.
  • The @sanity/date-input-package has been renamed to @sanity/rich-date-input, and the user will now get a console warning when using it, with instructions on how to migrate (https://sanity.io/help/deprecated-sanity-date-input).
  • Also removed @sanity/date-input from list of dependencies and plugins from sanity init

Side note: in the future we should probably replace react-datepicker with a native <input with type datetime-local. Its not fully supported yet (http://caniuse.com/#search=datetime-local), and I haven't been able to find a decent polyfill for it.

@bjoerge bjoerge requested a review from rexxars October 18, 2017 15:10
@bjoerge bjoerge changed the title Feature/simple date [form-builder] [schema] Add datetime type with default input Oct 18, 2017
@bjoerge bjoerge force-pushed the feature/simple-date branch 5 times, most recently from 4d694ed to ccd1500 Compare October 18, 2017 16:52
@thomax
Copy link
Contributor Author

thomax commented Oct 19, 2017

Good job on the refactoring. Seems date/time is one of those areas where there is no perfect solution, just the least painful one. Hoping or a painless future!

@thomax thomax merged commit bbecc2a into next Oct 19, 2017
@thomax thomax deleted the feature/simple-date branch October 19, 2017 11:40
bjoerge pushed a commit that referenced this pull request Oct 19, 2017
* [base] Get rid of deprecatedDate type

* [date-input] Rename common CSS file used by date input components

* [schema] Enable the string-based date type

* [date-input] Define string date part

* [schema] RichDate type uses date internally

* [date-input] Implement new string-based date type

* [test-studio] Add string-based date type to test studio schema

* [date-input] Include moment for a thinner Date.js

* [date-input] Use moment without timezone db

* [test-studio] Split dates schema

* [date-input] Refactor out some common date methods to a shared file

* [date-input] Move simple date input to form-builder and rename @santy/date-input to @sanity/rich-date-input

* [base] Import richDate legacy schema from deprecated @sanity/date-input package

* [form-builder] Add converter for richDate <=> datetime

* [form-buidler] Remove inputUtc option

* [form-builder] Disable keyboard navigation in date input

* [form-builder] Simplify conversion from richDate to datetime
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.

None yet

2 participants