Skip to content
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

Add "Today" to the Date Picker #6881

Closed
bahia0019 opened this issue May 21, 2018 · 14 comments
Closed

Add "Today" to the Date Picker #6881

bahia0019 opened this issue May 21, 2018 · 14 comments
Labels
[Feature] Document Settings Document settings experience Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.

Comments

@bahia0019
Copy link

Is your feature request related to a problem? Please describe.
Being able to bounce back to Today in the date picker should be performed by a simple button press rather than walking back through months/years.

Describe the solution you'd like
Add a "Today" button in the Date Picker UI
I'm attaching a few random Date Picker's on a Google image search.
The third one is Joomla's

date_picker
datepicker
datepicker1 calendar-en

@HardeepAsrani
Copy link
Contributor

React Date Picker, which is used by Gutenberg, does allow a "Today" button by default, but that button takes you to the current date of your browser, I suppose, not your WordPress timezone.

@bahia0019
Copy link
Author

That could work. I don't see that really being an issue.
If I click "Today" I would expect it to go to the actual "Today."
If I'm traveling in Australia and it's Wednesday, but my site is on US Pacific time, I'd expect it to go to Wednesday, not Tuesday.

@HardeepAsrani
Copy link
Contributor

Not like that, but let's imagine it this way:

My website is running on London time and it's Saturday night there, while it's Sunday in India. When I click on Today, it takes me to the current date which is Sunday in time, even tho it's Saturday for the website, so WordPress takes it as a future time, in my case.

@HardeepAsrani
Copy link
Contributor

I also see a utcOffset parameter, which should fix this issue.

@bahia0019
Copy link
Author

The scenario you laid out is exactly the same as mine, but with different countries.

Again, I would expect when I click Today, that it snaps to the Today of the timezone I'm currently in, not based on the WordPress setting.

@HardeepAsrani
Copy link
Contributor

No, that’s not what you want. If I do that in India right now, my post will be “Scheduled” instead of being Published. It’s hard to understand in text and I only understood when I tried that with code. :)

@HardeepAsrani
Copy link
Contributor

Yup, adding a timezone offset worked. Let me send a PR. :)

@HardeepAsrani
Copy link
Contributor

@bahia0019 Maybe you can also test on your side to make sure I didn't miss anything. :)

@bahia0019
Copy link
Author

Yeah, for sure. if I can figure it out. Kinda new to Git.

@HardeepAsrani
Copy link
Contributor

Clone my fork of the repo. Run npm install and then npm run build. You need to have npm installed. If you're not familiar with it, it takes a long time to get it setup for the first time, so grab some coffee before you start. :)

@bahia0019
Copy link
Author

I do need some coffee, but that's because I've got to figure out how to setup a Multisite on Google Cloud right now! :D
I'll see what I can do about this if I get some time. If not, hopefully it's merged into the next release of Gutenberg and I'll see it then.

Thanks for contributing to this!

@danielbachhuber danielbachhuber added [Type] Enhancement A suggestion for improvement. [Feature] Document Settings Document settings experience labels May 25, 2018
@danielbachhuber danielbachhuber added this to the WordPress 5.0 milestone May 25, 2018
@karmatosed karmatosed modified the milestones: WordPress 5.0, Future May 29, 2018
@mtias mtias added the Needs Design Feedback Needs general design feedback. label Jun 22, 2018
@tofumatt
Copy link
Member

tofumatt commented Jul 5, 2018

There's talk of using a new date picker component in #7621 (see: #7621 (comment)).

I think it's likely that this will be addressed when #1311 is addressed.

@karmatosed
Copy link
Member

As we have the new date component lets close this one and focus there.

@Kpudlo
Copy link

Kpudlo commented May 26, 2020

Would it be possible to open this back up? We finally switched our team over to Gutenberg and this was a requested feature.

If you look at the Classic Editor, the Today button is visible:
image

However, the Gutenberg Editor doesn't have that button:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Document Settings Document settings experience Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

7 participants