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

PublishDate cannot be set until post has been saved #574

Open
DorsetDigital opened this issue Feb 9, 2019 · 1 comment
Open

PublishDate cannot be set until post has been saved #574

DorsetDigital opened this issue Feb 9, 2019 · 1 comment

Comments

@DorsetDigital
Copy link
Contributor

DorsetDigital commented Feb 9, 2019

SilverStripe 4.3.0
Blog 3.2.3

I've come across some very annoying behaviour around the PublishDate when adding new Blog Posts.

  • Click 'Add new blog post'
  • Add a title, some content, an image
  • Click the 'Post Options' tag
  • Manually set a publish date on the datepicker field
  • Click 'Publish'

At this point the Publish Date field resets itself to the current date / time.

The same issue occurs in both Chrome and Opera (where the native datepicker works).
If you manually enter a date in Firefox, but do not enter a time, it works properly and sets the time to midnight.

Looking at the request, it seems the browsers which don't have a native datepicker are sending an empty value for the field if the time is not explicitly set.

I know that the removal of a datepicker has been discussed in a number of tickets in various places, but from a UI perspective, this is a bit of a regression since we're once again at the mercy of poor datepicker implementation in the browser.

I understand there is reluctance to re-introduce a datepicker library, but would separating the value into a date and time field be an acceptable solution to improve the UX? The underlying field could stay the same, but with a bit of logic to make the interface work.

@JorisDebonnet
Copy link
Contributor

One of my clients also complained about this. I would suggest maximizing UX (native when available, a js solution otherwise?) and then adding a preprocessor on the back-end to interpret the posted value as well as possible (i.e. support multiple formats).

I guess this is a general issue for DateTime fields though, not just for the Blog's PublishDate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants