GNU bug report logs - #52209
28.0.60; [PATCH] date-to-time fails on pure dates

Previous Next

Package: emacs;

Reported by: Bob Rogers <rogers-emacs <at> rgrjr.homedns.org>

Date: Tue, 30 Nov 2021 21:49:02 UTC

Severity: normal

Found in version 28.0.60

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Bob Rogers <rogers-emacs <at> rgrjr.homedns.org>
Cc: 52209 <at> debbugs.gnu.org
Subject: bug#52209: 28.0.60; [PATCH] date-to-time fails on pure dates
Date: Fri, 24 Dec 2021 10:29:29 +0100
Bob Rogers <rogers-emacs <at> rgrjr.homedns.org> writes:

> OK, I have proceeded along those lines; WIP attached for feedback.  I
> changed the name to "parse-date" to avoid confusion; I was otherwise
> stuck when trying to come up with a sensible name for the test file,
> since parse-time-tests.el was already taken (though I suppose I could
> have added to the existing file).

Sounds good to me.

> Which (additional) formats would you like?  I'm assuming we need iso8601
> and rfc822 for compatibility (in which case rfc2822 will be easy to
> provide in addition), and us-date and euro-date to disambiguate the
> month/day order.  Would the third format correspond to ISO 2001-01-03?
> Do we want to support that?

Probably not -- you mostly see that in Sweden.

> +(defun parse-date (time-string &optional format)

I think it'd be better if this was a cl-defmethod with an eql specifier
for the format.

> +   iso8601 => parse the string according to the ISO-8601
> +standard.  See `parse-iso8601-time-string'.
> +
> +   iso-8601 => synonym for iso8601.

And synonyms aren't necessary -- they just confuse people reading the
code.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 172 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.