feat(req-viewer): added today on since/until, added window-title (#221)

This commit is contained in:
Fernando López Guevara
2026-01-29 06:20:47 -03:00
committed by GitHub
parent fdc7b1499f
commit 0b3c657705
4 changed files with 15 additions and 3 deletions

View File

@@ -489,7 +489,7 @@ export function CreateSpellDialog({
onChange={(e) => setSince(e.target.value)}
/>
<div className="flex flex-wrap gap-1">
{["now", "1h", "24h", "7d", "30d"].map((t) => (
{["today", "now", "1h", "24h", "7d", "30d"].map((t) => (
<button
key={t}
onClick={() => setSince(t)}

View File

@@ -430,6 +430,12 @@ function parseTimestamp(value: string): number | null {
return Math.floor(Date.now() / 1000);
}
if (value.toLowerCase() === "today") {
const today = new Date();
today.setHours(0, 0, 0, 0);
return Math.floor(today.getTime() / 1000);
}
if (/^\d{10}$/.test(value)) {
return parseInt(value, 10);
}

View File

@@ -538,6 +538,12 @@ function parseTimestamp(value: string): number | null {
return Math.floor(Date.now() / 1000);
}
if (value.toLowerCase() === "today") {
const today = new Date();
today.setHours(0, 0, 0, 0);
return Math.floor(today.getTime() / 1000);
}
// Unix timestamp (10 digits)
if (/^\d{10}$/.test(value)) {
return parseInt(value, 10);

View File

@@ -213,12 +213,12 @@ export const manPages: Record<string, ManPageEntry> = {
{
flag: "--since <time>",
description:
"Events after timestamp (unix timestamp, relative: 30s, 1m, 2h, 7d, 2w, 3mo, 1y, or 'now')",
"Events after timestamp (unix timestamp, relative: 30s, 1m, 2h, 7d, 2w, 3mo, 1y, 'today' or 'now')",
},
{
flag: "--until <time>",
description:
"Events before timestamp (unix timestamp, relative: 30s, 1m, 2h, 7d, 2w, 3mo, 1y, or 'now')",
"Events before timestamp (unix timestamp, relative: 30s, 1m, 2h, 7d, 2w, 3mo, 1y, 'today' or 'now')",
},
{
flag: "--search <text>",