techouse / intl-date-time

International DateTime for Laravel Nova
MIT License
57 stars 21 forks source link

Today-button #20

Closed Jon78 closed 4 years ago

Jon78 commented 4 years ago

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.

techouse commented 4 years ago

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 😇

techouse commented 4 years ago

@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 https://github.com/flatpickr/flatpickr/issues/202#issuecomment-235801957 but no development was made on that part yet. Feel free to ask/comment about it in flatpickr's issues.

techouse commented 4 years ago

https://github.com/haoxins/react-flatpickr/issues/42

Jon78 commented 4 years ago

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 😀

techouse commented 4 years ago

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

techouse commented 4 years ago

Added in v1.5.1