[TxMt] Blogging bundle - dates and WordPress

Allan Odgaard throw-away-1 at macromates.com
Sun Jul 30 15:23:33 UTC 2006


On 30/7/2006, at 13:32, John Yeates wrote:

> [...] If I add a Date: header and change the date to some point in  
> the future the post still shows with the current time and I have to  
> edit the date through the WordPress interface.

Well, the blogging bundle doesn’t provide a date to non-MT systems  
because of a bug in blogging.rb.

However, if I fix it, a few other problems/bugs are revealed:

  1) the date parsed from the document is assumed to be GMT when it  
has no TZ. This is probably okay, as the date for fetched posts  
should also be GMT. Though it might be nice to switch to local dates.

  2) the date sent to the server has the time part stripped. This is  
sort of a bug in xmlrpc/create.rb in that it treats DateTime as Date  
with a time of day as 00:00:00. We can wrap it in an  
XMLRPC::DateTime, but care needs to be taken to not lose the TZ  
(which is actually lost for Date and Time objects.)

  3) WP does a lot with the received date, and I think half of it is  
wrong with respect to TZ. But as long as the date received is in GMT  
and the server uses GMT (plus the offset to GMT is set to zero in WP  
settings) it should come out correct.

I will update blogging.rb when I am assured that I have all the TZ  
stuff correct.

> BTW, is it particularly easy to add extra fields? I'd quite like to  
> add support for the event end time field for the EventCalendar  
> plugin (http://blog.firetree.net/2006/07/21/eventcalendar-31-beta/)

It’s fairly simple, yes.






More information about the textmate mailing list