edtf.js icon indicating copy to clipboard operation
edtf.js copied to clipboard

Unspecified digits incorrectly formatted

Open 1ec5 opened this issue 7 months ago • 1 comments

When a date contains unspecified digits, the format() function produces all X’s. For example:

> edtf.format(edtf.default('XXXX-04-01'));
// Expected: 4/1/X
// Actual: 4/1/?
> edtf.format(edtf.default('201X'));
// Expected: 2010s
// Actual: XXXX
> edtf.format(edtf.default('20XX'));
// Expected: 21st century
// Actual: XXXX
> edtf.format(edtf.default('20XX'));
// Expected: 3rd millennium
// Actual: XXXX
> edtf.format(edtf.default('XX00'));
// Expected (stretch goal): turn of the century
// Actual: X

1ec5 avatar Mar 14 '25 18:03 1ec5