Closed thet closed 2 years ago
@thet wouldn't be https://github.com/Eonasdan/bootstrap-datetimepicker the way to go?
I added plips/plip-2150-new-datetime-and-date-widgets.cfg
to buildout.coredev
.
To make it work build coredev with this cfg.
Then do:
./bin/plone-compile-resources -b plone
./bin/plone-compile-resources -GIb plone-logged-in
./bin/plone-compile-resources -GIb patterns
Start instance, then install a fresh Plone with addons and chooser Patternslib.
It is not finished.
Todo:
What's the state of this?
This needs some funding. For my part, the project where I use these branches is out of budget to finalize the PLIP.
@thet How much work will this be? I think we really need some solid widget here, the current situation on DateWidgets is bad. For a current project i needed more a TextWidget with the Date field, but even this was not easy to do. I had to use a custom DataConverter and a custom TextWidget to archive this. Plus i had to import the virtualtime package to get rid of the <1900 problem, as i needed date before 1900.
@MrTango you can use what's there (referenced in this PLIP) as I do. But this involves some branches of core packages, which is ugly to maintain. To get it into core, see the deliverables in the PLIP description. I think that could be doable within the scope of a sprint. Note, that the widget is only relevant for Safari and IE11 - all other browsers do already support a native widget. With these PLIP branches in place, I always get the native widgets in Firefox.
after reading @thet comments I think this PLIP doesn't worth the effort.
@hvelarde I you mean that the relevance of IE11 and Safari: Without the changes in this PLIP you won't get the browser's native date/time widgets. This PLIP changes the form inputs to datetime type including necessary changes all over the place. It's only the mockup widget which is only relevant for IE11 and Safari - because on modern browsers Pikaday's progressive enhancement feature doesn't load the JS widget but allows the native to take over (if configured to do so). Or what did you mean? IMO, this PLIP is worth the effort and it's almost ready.
I think it doesn't worth the effort to support deprecated browsers used by almost nobody; we already have a widget, isn't it? let's keep thing clean and simple.
but, you guys know better than I do.
There are the change we need to get the browser's native widget working, basically: https://github.com/plone/plone.app.z3cform/pull/90
@thet @jensens is that PLIP something that you still plan to work on? The last comment was from more than a year ago.
Maybe it would make sense to implement a new datetime/date widget in Volto first and then backport that to Plone Classic UI at a later point?
Maybe it would make sense to implement a new datetime/date widget in Volto first and then backport that to Plone Classic UI at a later point?
I would like to see that happen. I am sure in ReactJS-world there are many ready to use better datetime/date widgets around where we could pick from and integrate them.
Done in https://github.com/plone/plone.app.z3cform/pull/141 as part of the ES6 effort. Closing this.
Responsible Persons
Proposer: Johannes Raggam @thet
Seconder: Jens Klein @jensens
Abstract
This PLIP is about changing our date/time input widgets from
mockup-pattern-pickadate
, based onpickadate.js
to Patterns'pat-datetime-picker
based onPikaday
.Motivation
Our current date and time picker is based on pickadate.js (240 watchers, 7354 stars, 975 forks).
It has some usability problems:
It doesn't easily allow free date or time inputs (There were some discussions about allowing this. In the meantime there is an option, but then you have to add calendar bindings yourself.).
It doesn't do progressive enhancement by using a native widget if available in browser.
The time picker allows the selection of a time in configurable increments. This is inflexible or results in a much too long list to choose from.
Instead of using above, I propose to switch to
pat-datetime-picker
respectivelypat-date-picker
from the Patterns library. It uses Pikaday (186 watchers, 6104 stars, 1222 forks), which is similar but slightly less popular than pickaday.The advantages are:
Assumptions
~~- PLIP 1653 is accepted and implemented. This PLIP will depend on Patternslib integrated into Plone. See: https://github.com/plone/Products.CMFPlone/issues/1653~~ << NOT a precondition
Proposal & Implementation
I'm currently preparing an integration into Plone via https://github.com/plone/plone.patternslib/pull/23 for use in a project.
For this PLIP the implementation would be like outlined below:
date
respectivelydatetime-local
. Native widgets will make use of it.date
and atime
input field - again with their HTML5 types which browser-native widgets can make use of.datetime-local
compatible ISO 8601 format (https://en.wikipedia.org/wiki/ISO_8601, omitting seconds and the UTC offset). Currently it's not ISO 8601 compatible.Deliverables
pat-datetime-picker
.pat-date-picker
in the querystring pattern, deprecatemockup-patterns-pickadate
in docs and eventually remove it.date
and datetime input type todatetime-local
and usepat-date-picker
resp.pat-datetime-picker
.Risks
Some configuration options will change and the internals will work differently - the
updated
event on the original input will remain the same, though.There is no time picker (which might actually be an improvement). Browsers supporting native widgets for
time
input fields will provide one out of the box (mobile browsers + Google chrome). See also Can I Use 'input-datetime'The new datepicker is smaller than pickadate, which might be harder to use in mobile environments (although, OOTB we will allow the native date/time widgets of the mobile device be used instead).
Participants