plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
246 stars 186 forks source link

PLIP: New datetime and date widgets #2150

Closed thet closed 2 years ago

thet commented 7 years ago

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 on pickadate.js to Patterns' pat-datetime-picker based on Pikaday.

Motivation

Our current date and time picker is based on pickadate.js (240 watchers, 7354 stars, 975 forks).

It has some usability problems:

Instead of using above, I propose to switch to pat-datetime-picker respectively pat-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:

Deliverables

Risks

Participants

agitator commented 6 years ago

@thet wouldn't be https://github.com/Eonasdan/bootstrap-datetimepicker the way to go?

jensens commented 6 years ago

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:

tomgross commented 5 years ago

What's the state of this?

thet commented 5 years ago

This needs some funding. For my part, the project where I use these branches is out of budget to finalize the PLIP.

MrTango commented 5 years ago

@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.

thet commented 5 years ago

@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.

hvelarde commented 5 years ago

after reading @thet comments I think this PLIP doesn't worth the effort.

thet commented 5 years ago

@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.

hvelarde commented 5 years ago

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.

thet commented 5 years ago

There are the change we need to get the browser's native widget working, basically: https://github.com/plone/plone.app.z3cform/pull/90

tisto commented 4 years ago

@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?

jensens commented 4 years 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?

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.

thet commented 2 years ago

Done in https://github.com/plone/plone.app.z3cform/pull/141 as part of the ES6 effort. Closing this.