Initial commit: ReadLater v1.0

- Save articles via URL or bookmarklet
- Clean dark reader with customizable fonts/sizing
- Text-to-speech with browser + Kokoro support
- Speed control up to 3x
- Favorites and archive
- SQLite database with Drizzle ORM
- Docker deployment ready

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Gemini Agent
2026-01-17 07:35:07 +00:00
commit 27963af055
45 changed files with 11298 additions and 0 deletions

18
src/lib/utils/date.ts Normal file
View File

@@ -0,0 +1,18 @@
export function formatDistanceToNow(date: string | Date): string {
const d = new Date(date);
const now = new Date();
const diffMs = now.getTime() - d.getTime();
const diffSecs = Math.floor(diffMs / 1000);
const diffMins = Math.floor(diffSecs / 60);
const diffHours = Math.floor(diffMins / 60);
const diffDays = Math.floor(diffHours / 24);
const diffWeeks = Math.floor(diffDays / 7);
const diffMonths = Math.floor(diffDays / 30);
if (diffSecs < 60) return "just now";
if (diffMins < 60) return `${diffMins}m ago`;
if (diffHours < 24) return `${diffHours}h ago`;
if (diffDays < 7) return `${diffDays}d ago`;
if (diffWeeks < 4) return `${diffWeeks}w ago`;
return `${diffMonths}mo ago`;
}