techouse/intl-date-time

Today-button

Closed this issue · 6 comments

Jon78 commented

Not something that's necessarily relevant to this package, but my users are asking for a "today"-button, ie a button that selects the current time and date. This is something they were used to in the old jQuery-datepicker UI: https://jqueryui.com/datepicker/ Would be a nice enhancement.

I would love to help, however I am really short on time. If you have the time, please make a PR and I will merge it 😇

@Jon78 this component does not use any jQuery and instead uses the default datepicker of Nova flatpickr and a proposition for a today button has already been made here flatpickr/flatpickr#202 (comment) but no development was made on that part yet. Feel free to ask/comment about it in flatpickr's issues.

Jon78 commented

Thanks for the follow-up. We’ve actually found a workaround. Most times people use a “today” button would be to set an end date. So for instance you have a survey running, and when it has enough results you would want to stop it. Normally you would edit the resource, find the end date, put the end date to somewhere in the past, etc. A “today” button would save some clicks here, but a “stop now” action would save even more, especially since you can add it to the resource index 😀

Actually it looks like this can be accomplished using this package https://github.com/jcsmorais/shortcut-buttons-flatpickr

Added in v1.5.1