-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix: DateTimePicker passes current seconds as the selected seconds value #15495
Fix: DateTimePicker passes current seconds as the selected seconds value #15495
Conversation
This PR needs to be rebased with |
e2a710f
to
d1b1f66
Compare
Hi @gziolo this PR was rebased. |
This is great! Thanks for fixing @jorgefilipecosta! |
Any update on this? |
Could you elaborate on this? What causes cron to miss the posts? |
I explained it here - #13898 (comment) Use case: I setup wordpress to use system cron (setup a cronjob calling the wp-cron every minute for example). After setting up the cronjob I plan a post for the next week on 20:00. The time in database stored is 20:00:43 (43 in this case is seconds, fully random, but in fact this are my browser seconds). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A nice refactor of some duplicate logic too 👍
@@ -62,6 +63,12 @@ class TimePicker extends Component { | |||
} | |||
} | |||
|
|||
changeDate( newDate ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be nice for some docs, even if there's plenty of prior art of no documentation in this component.
d1b1f66
to
c270593
Compare
c270593
to
62c0af3
Compare
Closes: #13898
DateTimePicker does not allow users to pick a value for seconds, so when the user changes a time/date, it should look like a value of 0 was selected as the seconds value. Currently, the seconds of the current date are passed as the selected seconds, which may make it look like a "random" value was selected as the seconds value.
This causes a regression where WP_CRON missed some scheduled posts.
How has this been tested?
I created a new post.
I changed the date/time fields in the post scheduling dialog and I verified with redux dev tools that the editPost action contained a date whose seconds were equal to 0.