unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Allow unspecified dates in iso8601-valid-p?
@ 2022-07-04 12:47 Joost Kremers
  2022-07-04 15:34 ` Bob Rogers
  0 siblings, 1 reply; 4+ messages in thread
From: Joost Kremers @ 2022-07-04 12:47 UTC (permalink / raw)
  To: emacs-devel

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:

https://www.datafix.com.au/BASHing/2020-02-12.html

(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.

TIA

Joost


-- 
Joost Kremers
Life has its moments



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-04 16:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-04 12:47 Allow unspecified dates in iso8601-valid-p? Joost Kremers
2022-07-04 15:34 ` Bob Rogers
2022-07-04 16:21   ` Joost Kremers
2022-07-04 16:56     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).