-
Notifications
You must be signed in to change notification settings - Fork 29
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 time format with client side date parsing #415
Conversation
…enqueuing scripts" This reverts commit a5244fd.
16b8857
to
10a3340
Compare
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 fine to me. I've only reviewed the code, not tested.
const linkElement = document.createElement( 'a' ); | ||
linkElement.setAttribute( | ||
'href', | ||
`https://www.timeanddate.com/worldclock/fixedtime.html?iso=${ datetimeISO }` |
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.
Just noting for future possibilities: should we consider replacing timeanddate.com?
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.
The editor side looks great, but it's not working on the frontend, and I think something's off with how the time is converted. I entered "Wednesday July 12 2023 at 15:00 EDT", but the datetime attribute is using the UTC value plus the timezone (2023-07-12T19:00:00-04:00
).
Co-authored-by: Kelly Dwan <ryelle@users.noreply.github.com>
Hmm I hadn't tested with anything other than strings with UTC, as that's what I'd seen in posts. I'll take a look, ideally we could support more than that. |
For some reason this isn't working in my sandbox. The editor script loads and the format appears to be applied (inspecting the element in the editor shows the format), but when I save and load the frontend there is no format applied, and if I reload the editor the format is gone too. It's as if it's being stripped by some tag filter... @ryelle @tellyworth any ideas? |
Ahh, I don't see |
Thanks @ryelle this seems to work well |
🎉
Nice idea, I'll give it a try |
96088e5
to
82d9b2c
Compare
@ryelle I've implemented this now, please try again. |
Thanks for this testing. This is intermittent for me. I did manage to repro once, but after refreshing I can't repro again. I think we can merge and monitor. |
Use inline styles in editor and remove on frontend Handle post date being undefined and parse dates based on current time
Closes #413
This is an alternative approach to the server side implementation in #414
Pros:
the_content
Cons:
UPDATE:
If the time description changes, the format will now be removed so that it can be reapplied and parsed.