Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit c842232

Browse files
committed
Fixes: publish post when device time is set manually
1 parent 06ee04c commit c842232

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/post/PostRestClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,9 @@ private Map<String, Object> postModelToParams(
646646
params.put("author", String.valueOf(post.getAuthorId()));
647647
}
648648

649-
if (!TextUtils.isEmpty(post.getDateCreated())) {
649+
if (!TextUtils.isEmpty(post.getDateCreated())
650+
&& post.getStatus().equals(PostStatus.SCHEDULED.toString())
651+
) {
650652
params.put("date", post.getDateCreated());
651653
}
652654

fluxc/src/main/java/org/wordpress/android/fluxc/network/xmlrpc/post/PostXMLRPCClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ private static Map<String, Object> postModelToContentStruct(
507507

508508
String dateCreated = post.getDateCreated();
509509
Date date = DateTimeUtils.dateUTCFromIso8601(dateCreated);
510-
if (date != null) {
510+
if (date != null && post.getStatus().equals(PostStatus.SCHEDULED.toString())) {
511511
contentStruct.put("post_date", date);
512512
// Redundant, but left in just in case
513513
// Note: XML-RPC sends the same value for dateCreated and date_created_gmt in the first place

0 commit comments

Comments
 (0)