bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Lars Ingebrigtsen
Subject: bug#52209: 28.0.60; [PATCH] date-to-time fails on pure dates
Date: Fri, 24 Dec 2021 10:29:29 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Bob Rogers <rogers-emacs@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





reply via email to

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