fix: store time as timestamp_ms
This commit is contained in:
@@ -93,8 +93,8 @@ export const entriesTable = sqliteTable("entries", {
|
||||
author: text("author"),
|
||||
authorUrl: text("author_url"),
|
||||
authorAvatar: text("author_avatar"),
|
||||
insertedAt: integer("inserted_at", { mode: "timestamp" }).notNull(),
|
||||
publishedAt: integer("published_at", { mode: "timestamp" }).notNull(),
|
||||
insertedAt: integer("inserted_at", { mode: "timestamp_ms" }).notNull(),
|
||||
publishedAt: integer("published_at", { mode: "timestamp_ms" }).notNull(),
|
||||
media: text("media", { mode: "json" }).$type<MediaModel[]>(),
|
||||
categories: text("categories", { mode: "json" }).$type<string[]>(),
|
||||
attachments: text("attachments", { mode: "json" }).$type<AttachmentsModel[]>(),
|
||||
|
||||
@@ -89,10 +89,7 @@ function sortEntryIdsByPublishDate(a: string, b: string) {
|
||||
const entryA = getEntry(a)
|
||||
const entryB = getEntry(b)
|
||||
if (!entryA || !entryB) return 0
|
||||
return (
|
||||
entryB.publishedAt.getTime() - entryA.publishedAt.getTime() ||
|
||||
entryB.insertedAt.getTime() - entryA.insertedAt.getTime()
|
||||
)
|
||||
return entryB.publishedAt.getTime() - entryA.publishedAt.getTime()
|
||||
}
|
||||
|
||||
export const useEntryIdsByView = (view: FeedViewType, excludePrivate: boolean) => {
|
||||
|
||||
Reference in New Issue
Block a user