release: v0.20.0

This commit is contained in:
Ralksta
2026-10-02 18:14:23 +02:00
committed by GitHub
parent 81ce886b01
commit 5f831f719a
209 changed files with 13807 additions and 803 deletions

View File

@@ -1,5 +1,5 @@
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
import { formatJournalDate } from '../journalDate';
import { formatJournalDate, journalDateTime } from '../journalDate';
/**
* The /journal index formatted `new Date(frontmatter.date)` in the server's
@@ -49,3 +49,22 @@ describe('formatJournalDate', () => {
expect(formatJournalDate(' ', 'en-US')).toBeNull();
});
});
/** The `datetime` of the `<time>` the index and the entry header render (P-21). */
describe('journalDateTime', () => {
it('gives the calendar day, without the time a value may carry', () => {
expect(journalDateTime('2026-03-15')).toBe('2026-03-15');
expect(journalDateTime(' 2026-03-15T23:30:00+01:00 ')).toBe('2026-03-15');
});
it('gives a year-month value as a month', () => {
expect(journalDateTime('2026-03')).toBe('2026-03');
});
it.each(['15.03.2026', 'Spring 2026', '2026-02-30', '2026-13', '', undefined])(
'has no machine-readable form for %s',
(raw) => {
expect(journalDateTime(raw)).toBeNull();
},
);
});