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

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

bug#40137: 25.1; ERC ignore function should allow specifying a limited d


From: Lars Ingebrigtsen
Subject: bug#40137: 25.1; ERC ignore function should allow specifying a limited duration
Date: Sun, 02 Aug 2020 20:31:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Amin Bandali <bandali@gnu.org> writes:

> Anyhow, if anyone knows functions for parsing relative dates/times, I'd
> appreciate it if you could point them out to me.

Looks like org-element-timestamp-parser is the org time parser...
probably a bit excessive.  :-)

We'd want to parse stuff like 1m3d, right?  Which is awfully like what
iso8601-parse-duration accepts:

(iso8601-parse-duration "P3Y6M4DT12H30M5S")
=> (5 30 12 4 6 3 nil -1 nil)

(iso8601-parse-duration "P3W")
=> (nil nil nil 21 nil nil nil -1 nil)

So just upcase and add a P to the start and we're there.  :-)

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