Fix RSS time filters and add draggable grid layout
Normalize pub_date to ISO 8601 on insert so SQLite datetime comparisons work correctly. Migrate existing RFC 2822 dates. Change 1h filter to 12h. Add react-grid-layout with persistent drag/resize and reset button. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,13 @@ import Parser from 'rss-parser';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
function normalizeDate(item: { isoDate?: string; pubDate?: string }): string | null {
|
||||
const raw = item.isoDate || item.pubDate;
|
||||
if (!raw) return null;
|
||||
const d = new Date(raw);
|
||||
return isNaN(d.getTime()) ? null : d.toISOString();
|
||||
}
|
||||
|
||||
export async function GET() {
|
||||
const db = await getDb();
|
||||
const feeds = await db.all(`
|
||||
@@ -56,7 +63,7 @@ export async function POST(req: NextRequest) {
|
||||
feedId,
|
||||
item.title,
|
||||
item.link,
|
||||
item.pubDate || item.isoDate || null,
|
||||
normalizeDate(item),
|
||||
item.creator || item.author || null,
|
||||
(item.contentSnippet || item.content || '').substring(0, 500) || null
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user