From 9571c5993d56e81cebfcb94260e2635c6e2f1bf5 Mon Sep 17 00:00:00 2001 From: Renan Lukas <14964993+RenanLukas@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:40:04 -0300 Subject: [PATCH] Add datetime function to getOldestPubDateInBlog 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 7f5c63bb4fbc..7f0e3df6b9a2 100644 --- a/WordPress/src/main/java/org/wordpress/android/datasets/ReaderPostTable.java +++ b/WordPress/src/main/java/org/wordpress/android/datasets/ReaderPostTable.java @@ -658,7 +658,7 @@ public static String getOldestDateWithTag(final ReaderTag tag) { public static String getOldestPubDateInBlog(long blogId) { String sql = "SELECT date_published FROM tbl_posts" + " WHERE blog_id=? AND tag_name='' AND tag_type=0" - + " ORDER BY date_published LIMIT 1"; + + " ORDER BY datetime(date_published) LIMIT 1"; return SqlUtils.stringForQuery(ReaderDatabase.getReadableDb(), sql, new String[]{Long.toString(blogId)}); }