This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET TIME ZONE 'America/New_York'; | |
| create extension if not exists moddatetime schema extensions; | |
| DO $$ | |
| DECLARE | |
| r RECORD; | |
| trigger_name text; | |
| BEGIN | |
| FOR r IN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { formatDistanceToNowStrict } from 'date-fns' | |
| import { enUs } from 'date-fns/locale' | |
| function formatPublishedSince(date) { | |
| try { | |
| const publishedSince = formatDistanceToNowStrict(new Date(date), { | |
| locale: enUs, | |
| }) | |
| return `${publishedSince} ago` | |
| } catch (e) { |