MeisterGit / wordpress-java

Automatically exported from code.google.com/p/wordpress-java
Other
0 stars 0 forks source link

Setting Create Date Does Not Appear to Work #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Whenever I add a post via the API, the date created is May 26 2010 (it is
June 4 2010).  I even tried to enter a date using Calendar:

Calendar c = Calendar.getInstance();
c.set(2010, Calendar.AUGUST, 12);
post.setDateCreated(c.getTime());

This too results in May 26 2010.  

Am I not setting the create date correctly?  

Original issue reported on code.google.com by djever...@gmail.com on 5 Jun 2010 at 2:33

GoogleCodeExporter commented 9 years ago

Original comment by can.bican@gmail.com on 6 Aug 2010 at 8:38

GoogleCodeExporter commented 9 years ago

Original comment by can.bican@gmail.com on 6 Aug 2010 at 8:38

GoogleCodeExporter commented 9 years ago
Sorry for getting back late, now I had a chance to start with it. It seems that 
dateCreated requires a special type. While I fix this, you can try 
date_created_gmt, it seems to work...

Original comment by can.bican@gmail.com on 19 Aug 2010 at 8:55

GoogleCodeExporter commented 9 years ago
OK, it seems that the current wordpress code first checks date_created_gmt and 
then dateCreated only if date_created_gmt is not present. I changed the code 
such that when one of the is set to something, the other is set to null.

Fixed in Revision 66. So just check out the source and try it out. I'll be 
releasing a new version soon.

Original comment by can.bican@gmail.com on 22 Aug 2010 at 3:30