X.P.OrgMode: Start counting years at 25

This is for disambiguation purposes.  Otherwise, there is no way to
decide whether

    message +s 17 jul 12

wants to schedule the note for the 17th of july at 12:00, or for
the 17th of july in the year 12.  The easiest way around this is to
stipulate that people want to make these notes for the future more
often than not and to simply prohibit note before the year 25 (as that
is where the valid times end).
This commit is contained in:
slotThe 2021-06-13 16:52:41 +02:00
parent 4b15ea2ecc
commit 1c6e6c808d

View File

@ -114,6 +114,11 @@ above, pressed it, and are now confronted with a prompt:
- @hello +s 11 jan 2013@ would schedule the note for the 11th of - @hello +s 11 jan 2013@ would schedule the note for the 11th of
January 2013. January 2013.
Note that, due to ambiguity issues, years below @25@ result in undefined
parsing behaviour. Otherwise, what should @message +s 11 jan 13@
resolve tothe 11th of january at 13:00 or the 11th of january in the
year 13?
There's also the possibility to take what's currently in the primary There's also the possibility to take what's currently in the primary
selection and paste that as the content of the created note. This is selection and paste that as the content of the created note. This is
especially useful when you want to quickly save a URL for later and especially useful when you want to quickly save a URL for later and
@ -393,7 +398,7 @@ pDate = skipSpaces *> lchoice
, pString "s" "eptember" 9 , pString "o" "ctober" 10 , pString "s" "eptember" 9 , pString "o" "ctober" 10
, pString "n" "ovember" 11, pString "d" "ecember" 12 , pString "n" "ovember" 11, pString "d" "ecember" 12
]) ])
<*> p' (skipSpaces *> pInt) <*> p' (skipSpaces *> pInt >>= \i -> guard (i >= 25) $> i)
-- | Parse a @start@ and see whether the rest of the word (separated by -- | Parse a @start@ and see whether the rest of the word (separated by
-- spaces) fits the @leftover@. -- spaces) fits the @leftover@.