This commit is contained in:
Timothy Jaeryang Baek
2026-04-01 00:11:11 -05:00
parent 378673408e
commit 8a0794958d
3 changed files with 89 additions and 40 deletions
@@ -100,6 +100,15 @@
};
const formatRRule = (rrule: string): string => {
// Detect one-time schedule (ONCE)
if (rrule.includes('COUNT=1')) {
const match = rrule.match(/DTSTART:(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})/);
if (match) {
const d = new Date(`${match[1]}-${match[2]}-${match[3]}T${match[4]}:${match[5]}`);
return `Once · ${d.toLocaleDateString(undefined, { month: 'short', day: 'numeric' })} ${d.toLocaleTimeString(undefined, { hour: 'numeric', minute: '2-digit' })}`;
}
return 'Once';
}
const parts: Record<string, string> = {};
rrule
.replace('RRULE:', '')