mirror of
https://github.com/eliasrenman/url-shortener.git
synced 2026-03-17 04:26:05 +01:00
feat: links expiry
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
<tr>
|
||||
<th class="p-3">Shortform</th>
|
||||
<th class="p-3">Destination</th>
|
||||
<th class="p-3">Expire date</th>
|
||||
<th class="p-3">Expires at</th>
|
||||
<th class="p-3">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { mutateDeleteUrl, type Url } from "@/api/url";
|
||||
import { Edit, Trash } from "@lucide/svelte";
|
||||
import { formatRelative } from "date-fns";
|
||||
|
||||
let { row }: { row: Url } = $props();
|
||||
|
||||
@@ -33,7 +34,10 @@
|
||||
></td
|
||||
>
|
||||
<td class="p-3 truncate"
|
||||
>{row.ttl ? new Date(row.ttl).toLocaleTimeString() : "Never"}</td
|
||||
>{row.ttl
|
||||
? // Manually specifying Z at the end here since the date format saved in the database removes timezone info but we know it is saved as UTC+0
|
||||
formatRelative(new Date(row.ttl + "Z"), new Date(), {})
|
||||
: "Never"}</td
|
||||
>
|
||||
<td class="p-3 flex gap-3">
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user