Add support for weekly repeating events#14
Open
szabolcs-szilagyi wants to merge 2 commits intomsherry:masterfrom
Open
Add support for weekly repeating events#14szabolcs-szilagyi wants to merge 2 commits intomsherry:masterfrom
szabolcs-szilagyi wants to merge 2 commits intomsherry:masterfrom
Conversation
This adds support for events that repeats on chosen days of the week. E.g. repeating every Tuesday and Monday. The solution isn't the most elegant, as we parse the date again from a previously parsed, then formatted source (the `date` variable), but for a more elegant solution we would need to refactor other methods as well. For the repeating the following format is used (note the dates beneth): ``` * Pretend to do some sport :PROPERTIES: :ID: a3f62a3f-5d6f-4956-9adc-a94b73438b34 :LOCATION: Local Gym :STATUS: CONFIRMED :ATTENDING: ATTENDING :ATTENDEES: :END: :LOGBOOK: CLOCK: [2023-07-15 Sat 10:15]--[2023-07-15 Sat 10:30] => 0:00 :END <2023-07-17 Mon 10:15-10:30 +1w> <2023-07-18 Tue 10:15-10:30 +1w> <2023-07-19 Wed 10:15-10:30 +1w> <2023-07-20 Thu 10:15-10:30 +1w> ``` Other solution could be to use a lisp expression to setup, but for me that is too obsucre, hard to read at glance. E.g.: ``` ** Daily meeting <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))> ``` source: https://orgmode.org/worg/org-faq.html#orga9d21b4
The previous solution wouldn't reconigize, if the event is repeating on a single day. With the new pattern the grouping goes like follows: - two uppercase letter - followed by an optional coma - one or more repeats of the above two - the above group followed by an optional semicolon
Author
|
Interestingly the Sample event that can be used for testing: Will produce the following: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds support for events that repeats on chosen days of the week. E.g. repeating every Tuesday and Monday.
The solution isn't the most elegant, as we parse the date again from a previously parsed, then formatted source (the
datevariable), but for a more elegant solution we would need to refactor other methods as well.For the repeating the following format is used (note the dates beneth):
Other solution could be to use a lisp expression to setup, but for me that is too obsucre, hard to read at glance. E.g.:
source: https://orgmode.org/worg/org-faq.html#orga9d21b4
Possible solution for #6