|
35 | 35 | (defconst org-blog-wp-alist |
36 | 36 | (list (cons :category "category") |
37 | 37 | (cons :content "post_content") |
38 | | - (cons :date "post_date") |
| 38 | + (cons :date "post_date_gmt") |
39 | 39 | (cons :description "post_excerpt") |
40 | 40 | (cons :id "post_id") |
41 | 41 | (cons :keywords "post_tag") |
@@ -67,11 +67,8 @@ sorted." |
67 | 67 | (org-blog-post-to-wp-add-taxonomy wp "category" v)) |
68 | 68 | ((eq :date k) |
69 | 69 | ;; Convert to GMT by adding seconds offset |
70 | | - (cons |
71 | | - (cons "post_date_gmt" (list :datetime |
72 | | - (time-add v |
73 | | - (seconds-to-time (- (car (current-time-zone))))))) |
74 | | - wp)) |
| 70 | + (let ((gmt (time-add v (seconds-to-time (- (car (current-time-zone))))))) |
| 71 | + (cons (cons "post_date_gmt" (list :datetime gmt)) wp))) |
75 | 72 | ((eq :keywords k) |
76 | 73 | (org-blog-post-to-wp-add-taxonomy wp "post_tag" v)) |
77 | 74 | ((eq :title k) |
@@ -117,7 +114,7 @@ sorted." |
117 | 114 | post) |
118 | 115 | ((string= "terms" k) |
119 | 116 | (org-blog-wp-to-post-handle-taxonomy post v)) |
120 | | - ((string= "post_date" k) |
| 117 | + ((string= "post_date_gmt" k) |
121 | 118 | (cons (cons (car (rassoc k org-blog-wp-alist)) (plist-get v :datetime)) post)) |
122 | 119 | ((rassoc k org-blog-wp-alist) |
123 | 120 | (cons (cons (car (rassoc k org-blog-wp-alist)) v) post)) |
@@ -260,13 +257,12 @@ call the specified function and return the results." |
260 | 257 |
|
261 | 258 | ;;;; Define tests if ert is loaded |
262 | 259 | (when (featurep 'ert) |
263 | | - (setq xml-rpc-debug 5) |
264 | 260 | (ert-deftest ob-test-post-to-wp () |
265 | 261 | "Transfer from buffers to posts and back again" |
266 | 262 | (let ((post1-struct '((:blog . "t1b") |
267 | 263 | (:category "t1c1" "t1c2") |
268 | 264 | (:content . "<p>\nTest 1 Content</p>\n") |
269 | | - (:date 20738 4432 0 0) |
| 265 | + (:date 20738 4432) |
270 | 266 | (:description . "t1e") |
271 | 267 | (:id . "1") |
272 | 268 | (:keywords "t1k1" "t1k2" "t1k3") |
@@ -310,7 +306,7 @@ call the specified function and return the results." |
310 | 306 | ("post_date" :datetime |
311 | 307 | (20738 4432)) |
312 | 308 | ("post_date_gmt" :datetime |
313 | | - (20738 18832 0 0)) |
| 309 | + (20738 4432)) |
314 | 310 | ("post_modified" :datetime |
315 | 311 | (20738 4432)) |
316 | 312 | ("post_modified_gmt" :datetime |
|
0 commit comments