-
Notifications
You must be signed in to change notification settings - Fork 76
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
Use Datepair.js and jquery-timepicker for selecting time ranges #308
base: develop
Are you sure you want to change the base?
Conversation
This replaces the existing time range selection solution, which uses jQuery UI Timepicker, with Datepair.js and jquery-timepicker. Datepair.js automatically updates the end time when the start time is changed. This makes for a more user-friendly experience.
Hi @r-a-y Thanks for the PR. That looks like its a11y friendly, is definitely i18n-friendly and I agree - is generally a better UI. I'll need to check this out and see how the time range logic handles long events (start and end date are on different dates). That is, by the way, what the snippets you refer to were doing: removing any restrictions on time selection when the event start and end date were on different dates. One concern is that its harder to select a time for events which don't start and end on the hour or half hour. That could be mitigated by having 5, 10, 15 minute steps - but a balance would need to be struck between granularity and having to scroll through a long list of times. (You can of course manually edit times). The other concern is that the FES extension uses this on the front-end. I'll need to check the implications of this change on FES and what workarounds are possible. 3.0.0 is already in its 5th beta stage, and while I'm anticipating an extended beta period for that release I think its best to mark this for 3.1.0 |
Good call. This doesn't appear to work correctly in the current PR. If I change the end date to another day, the time duration doesn't update for the end time. I'll look into this.
Yeah for sure. That is probably the only hindrance from using this new UI. Maybe we can let this be an admin option? Default to 30 mins.
I tested this in BP Event Organiser, which also has a front-end posting component and it works there, but the code in BPEO uses the existing metabox functionality from the admin to generate that stuff. If FES follows a similar guideline with enqueuing and registering scripts, then it should work, but you should know more than me ;)
I'm fine with whatever you decide! |
I had a play with Google calendar and it seems that the duration only appears when it is less than 24 hours. So jQuery Time Picker correctly mimics this. I'm not sure yet whether this is a design choice or there are technical difficulties in doing implementing this, but one reasonably common user error is to set the end date of a recurring event to the date they actually want the event to stop recurring. My hope is that displaying a duration might help disambiguate the label 'End'. In any case, I'm thinking about including the duration in the event summary that appears below the date configuration. |
…ting an event. Until this is addressed in EO core, we do our own thing in BPEO. This only takes effect for BPEO's frontend editor. See stephenharris/Event-Organiser#308
Hi Stephen, Do you have any other thoughts about this pull request and what else needs to be addressed? |
Hi Ray, Just to summarise some of the concerns I had, and where I think we're now at.
So I think if the PR can meet (1) and (2), then this would be good to merge in. |
Hi Stephen,
This PR replaces the existing time range selection solution, which uses jQuery UI Timepicker, with
Datepair.js
andjquery-timepicker
.Datepair.js
automatically updates the end time when the start time is changed. This makes for a more user-friendly experience.Here's a GIF showing what it looks like:

Both
Datepair.js
andjQuery-timepicker
are licensed under the MIT:https://github.com/jonthornton/Datepair.js
https://github.com/jonthornton/jquery-timepicker
The only question I have is lines 274-277 currently in
event.js
:https://github.com/stephenharris/Event-Organiser/blob/develop/js/event.js#L274-L277
This part might need to be altered to work with the new JS.
Let me know if you have any questions!