[TxMt] Blogging: Post to Wordpress messes up date

Gerd Knops gerti-textmate at bitart.com
Mon Aug 14 04:54:52 UTC 2006


The patch below fixes the issue for me. It should work fine with all  
WP blogs that are in the same timezone as the user. Of course it'll  
break once WP gets fixed, but that doesn't seem to be on the horizon.

Gerd


--- blogging.rb.orig    2006-08-13 23:10:40.000000000 -0500
+++ blogging.rb 2006-08-13 23:50:33.000000000 -0500
@@ -404,6 +404,7 @@
      # Convert XMLRPC:DateTime to a regular DateTime object so
      # that we can show the date using the users local time zone.
      d = DateTime.civil(*self.post['dateCreated'].to_a)
+    d+=-DateTime.now.offset if (self.mode == 'wp')
      doc += d.new_offset(DateTime.now.offset).strftime("Date: %F %T % 
z") + "\n"
      if self.post['mt_allow_pings'] && (self.post['mt_allow_pings']  
== 1)




More information about the textmate mailing list