readerbookmark: fix date sort (#12053)
This commit is contained in:
1 parent
9fd6c82b3b
commit
fa4654cdfa
1 file changed
+2
-1
@@ -643,7 +643,8 @@ function ReaderBookmark:onShowBookmark()
|
||||
end
|
||||
local curr_page_datetime
|
||||
if self.sorting_mode == "date" then
|
||||
curr_page_datetime = item_table[curr_page_index_filtered].datetime
|
||||
local idx = math.max(1, math.min(curr_page_index_filtered, #item_table))
|
||||
curr_page_datetime = item_table[idx].datetime
|
||||
local sort_func = self.is_reverse_sorting and function(a, b) return a.datetime > b.datetime end
|
||||
or function(a, b) return a.datetime < b.datetime end
|
||||
table.sort(item_table, sort_func)
|
||||
|
||||
Reference in new issue
Block a user