italia / publiccode-editor

A web editor to create and edit publiccode.yml files
https://publiccode-editor.developers.italia.it
GNU Affero General Public License v3.0
20 stars 25 forks source link

Date picker is not rendered on Safari #15

Closed alranel closed 5 years ago

alranel commented 5 years ago

Date fields like "Release Date" do not enforce or suggest any particular format (for example YYYY-MM-DD) and there's no date picker. We should at least suggest the format.

libremente commented 5 years ago

I can see the date picker (FF 65 / GNU/Linux), however the only format recognized is the YYYY-MM-DD see https://docs.italia.it/italia/developers-italia/publiccodeyml/it/master/schema.html#data

alranel commented 5 years ago

After further checks, I realized that this issue is only specific to Safari, where the placeholders and the picker are not rendered.

Safari: screen shot 2019-03-04 at 18 11 53

Firefox: screen shot 2019-03-04 at 18 12 04

We should probably change the input field to show the date in YYYY-MM-DD format, but the current behavior is fine.

I'm moving this issue to 1.1 and renaming it.

sebbalex commented 5 years ago

Seems we have a problem with this component. Safari is still not supported (even in latest version). Format pattern follows browser language and normalized after input, there is no API to change placeholder at the moment.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date

We should consider to move to another one.

libremente commented 5 years ago

Weird, I'd go with the https://jqueryui.com/datepicker. JQuery is already loaded, jquery UI is not but I guess that including it shouldn't be too much of an hassle. What do you think @sebbalex? At least we ensure that it is supported by all the major browsers https://jqueryui.com/browser-support/

sebbalex commented 5 years ago

@libremente I would go for https://jquense.github.io/react-widgets/api/DateTimePicker/ as we already have in our dependency and we're actually using it for other components. It should cover as well all major browsers, what do you think?

libremente commented 5 years ago

@sebbalex If that's supported by all browser then great, go for it! :+1: