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:
Shivam Patel
2026-02-09 17:51:06 -05:00
parent 717d52bd9a
commit 4ee365cfc0
13 changed files with 324 additions and 47 deletions

View File

@@ -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
);