orgize icon indicating copy to clipboard operation
orgize copied to clipboard

FR: Timestamps: Accept timestamps with DAYNAME, repeater, and delay in any order

Open calmofthestorm opened this issue 4 years ago • 1 comments

The Org spec requires the order be DAYNAME, then repeater-or-delay up to twice, but org-mode and org-element are robust, and will parse them in any order. So for example, these would all be accepted identically:

[2020-01-01 5:05 .+1w Fri --2d] [2020-01-01 5:05 .+1w --2d Fri] [2020-01-01 5:05 Fri .+1w --2d]

also valid is [2020-01-01 5:05 .+1w --2d]; covered under #27 .

calmofthestorm avatar May 11 '20 22:05 calmofthestorm

#32 partially fixes this by accepting repeater and delay in either order. Dayname still must precede them, however.

calmofthestorm avatar May 12 '20 21:05 calmofthestorm

I just checked the implementation of parsing timestamp in org-elements api and find out it's quite flexible. The org-element parser will first accepts any string that starts with [yyyy-mm-dd and ends with ] as valid timestamp, then try to extract time/repeater/delay out of it.

It's possible for orgize to follow the same logic as org-elements, but I think it's more like implementation details instead of edge cases we need to handle. People would not write [2003-09-16 09:09-a 09:09-10:09] or [2003-09-16 abc abc bac 07:09-08:09]--[2003-09-16 09:09-09:09-09] and expect there're valid timestamps.

PoiScript avatar Nov 20 '23 10:11 PoiScript