-
Notifications
You must be signed in to change notification settings - Fork 28
Term description of date fields have timezone #67
Conversation
Isn't there a way to store the timezone as part of the |
There is, but there are a couple problems with it. For instance, when a date is saved, the information is in a tag below the input fields. When saving the post again there isn't any of the data in the $_POST dictionary is it gets wiped out each time. And on top of that, if we just put the data back in the input fields, the post would resave data that we already saved or, more importantly, if it were a field that allowed multiple dates then we couldn't know which date data to put back into the input fields. |
The real solution is to move the date fields away from saving into a taxonomy. That's a bigger effort. |
How is the timezone set on the front end? |
In each of the |
Which already existed? It just wasn't being stored in this manner, before? |
It was added when |
@dpford @Scotchester @jimmynotjim this should get in before we start really putting content into Wordpress for events, as the event ics file relies on this to work correctly. |
Tested locally and working. Thanks for making the formatting the same across timestamps. 👍 |
@jimmynotjim Did you run the tests? That was the only thing I wanted to do before diving a thumbs up. |
+1 for working locally, have to install phpunit to run tests |
yep, just ran the tests with Kurt's help getting phpunit working. |
and kurt is the bomb (downside to screenhero is kurt patting himself on the shoulder) |
Merging since it has enough thumbs. Up that is. |
Term description of date fields have timezone
When a single
datetime
/time
is saved, it is saved in a taxonomy as a term. In this term, the description is empty. This uses the empty description to save the timezone of the field. This is useful for the event ics file generation. Without it, the event start/end times are set in the UTC timezone.Test
Save an unrepeated
time
ordatetime
field and look at the api output. If the term has a description that matches the timezone selected for the field, then mission accomplished.@jimmynotjim @Scotchester