From 10b9f806ed9b5b89637ad0556f8c6c96a5c53a4a Mon Sep 17 00:00:00 2001 From: Renan Lukas <14964993+RenanLukas@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:42:27 -0300 Subject: [PATCH] Add datetime function to getPostsInBlog sorting --- .../java/org/wordpress/android/datasets/ReaderPostTable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPress/src/main/java/org/wordpress/android/datasets/ReaderPostTable.java b/WordPress/src/main/java/org/wordpress/android/datasets/ReaderPostTable.java index bf0ab39f10e3..4d2ab0fab2bb 100644 --- a/WordPress/src/main/java/org/wordpress/android/datasets/ReaderPostTable.java +++ b/WordPress/src/main/java/org/wordpress/android/datasets/ReaderPostTable.java @@ -982,7 +982,7 @@ public static ReaderPostList getPostsInBlog(long blogId, int maxPosts, boolean e String columns = (excludeTextColumn ? COLUMN_NAMES_NO_TEXT : "*"); String sql = "SELECT " + columns + " FROM tbl_posts WHERE blog_id=? AND tag_name='' AND tag_type=0" - + " ORDER BY date_published DESC"; + + " ORDER BY datetime(date_published) DESC"; if (maxPosts > 0) { sql += " LIMIT " + maxPosts;