[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Allow unspecified dates in iso8601-valid-p?

From: Joost Kremers
Subject: Allow unspecified dates in iso8601-valid-p?
Date: Mon, 04 Jul 2022 14:47:08 +0200
User-agent: mu4e 1.8.3; emacs 28.1.90

Hi list,

The function `iso8601-valid-p` can be used to check if a string constitutes a
valid ISO8601-formatted date. It seems that ISO8601 is a big spec with several
modifications and extensions, so I'm sure it's hardly doable to support
everything the spec allows, but I'm wondering if it would be possible to allow
unspecified dates.

The relevant spec is described here:


(There are several parts here, the one I'm referring to is under "Unspecified").
It explains that a capital X can be used to indicate parts of a date that are
unspecified, i.e., "20XX" for a year in the 21st century.

The reason behind this request is that `bibtex.el`, when creating a key for an
entry, checks the date field against `iso8601-valid-p` and errors out if it
finds an invalid date. Problem is that sometimes publication dates simply are
not known or cannot be given, which is exactly the kind of reason why the
unspecified date extension to ISO8601 exists.

One option would be to add an additional argument to `iso8601-valid-p` that
indicates whether to allow unspecified dates or not, but in that case,
`bibtex.el` would have to be adjusted as well.



Joost Kremers
Life has its moments

reply via email to

[Prev in Thread] Current Thread [Next in Thread]