Open coreymckrill opened 3 years ago
It does that now, see #65
This issue different from #65. It's referencing the time picker when you are specifically editing an update.
Do we want to use the default Gutenberg messaging system or try something in-line?
Also, I looked into controlling the minimum date but the Gutenberg control, which wraps a third party one that does support the feature, doesn't expose the minDate
property.
Screenshot
Is this screenshot the default GB messaging, or something custom? Default would be my first preference. The screenshot looks fine.
the Gutenberg control, which wraps a third party one that does support the feature, doesn't expose the minDate property.
D'oh. That might be worth filing an issue in the GB repo.
Is this screenshot the default GB messaging, or something custom? Default would be my first preference. The screenshot looks fine.
No, Gutenberg doesn't have a messaging system within the sidebar (75% sure :)). The default messaging is the one that appears at the top of the document that we have already used as the main update editing landmark.
Here's a variation using WP Admin's notice
and notice-error
classes for the message container:
Noting: I looked into adding a PR for Gutenberg to accept a minDate
since the underlying datepicker library does support it. However, Gutenberg imports a very specific version of the picker from that library that does not support it (https://github.com/airbnb/react-dates/blob/7a93b097af2e4f4ca8f8e6a329b213f49d70bd98/src/components/DayPickerSingleDateController.jsx#L37).
For now, we'll need to manage this internally.
If you edit a scheduled update, and change the date to sometime in the past, the button changes to "Publish", but clicking it doesn't actually publish anything (which is good, since revisions should never be published themselves). Ideally, I think, the editor would just show an error message if you tried to set a date in the past.