| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
The property parameter time zone identifier (TZID) is recognized in DTSTART,
DTEND and EXDATE and the DATE-TIME value converted to a local time. The time
zone identifier is logged in the note file.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
| |
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
In addition, the prompt text is shortened.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
| |
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
Better name: day for occur.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the order of a weekday in BYDAY rule expansion (like -5SA or 5SU
for monthly or 55WE for yearly) exceeds the number of available weekdays
in the period (month or year), rule expansion with negative order could
result in a floating point exception. The reason: the modified frequency
might become zero.
Solution. Check order against number of available weekdays and terminate
expansion early whenever possible (also for positive orders).
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch derives the item type (appointment or event) from the DTSTART
value type. It is then used to perform an extended check of date/time
values and reject non-conformant import files (like those reported in
Github issues #81, (calcurse) events.
The patch includes parsing and code corrections and minor refactoring.
Background:
Ical events are of two types, in calcurse called appointments and
events. RFC 5545 has no distinguishing names for them, but describes
them in section 3.6.1. The event type is derived from the value type of
the DTSTART property. The value type may be either DATE-TIME
(appointment) or DATE (event). If not specified by a VALUE property
parameter in DTSTART, the default value type is DATE-TIME. The value
type must be set explicitly to DATE to get an event. Other properties
and rrule parts must agree with the DTSTART value type (DTEND, DURATION,
EXDATE and UNTIL).
Previously the type of an imported event was derived from the format of
the DTSTART value. The DTSTART value type was not taken into account
when importing, and not specified for recurring events when exporting
(commit 0114289 solved it for events, see GitHub PR #97).
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
| |
Fixes #283.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
| |
This patch makes check_dir(dir) create directories if they don't exist,
and it will fail if the path at dir is not a directory. It acts in a
similar fashion to io_check_dir from io.c.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
The generic command 'next' is introduced.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
| |
The help command has been updated for "repeat".
Context dependent, very terse information is built into the repeat
command (edit command) for display in the status bar when editing the
Weekdays, Months and Monthdays lists.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The day vector (or "day_items" vector) is used to load the appointments
panel with "day_items" (captions, appointments, events). A multi-day
appointment has several "day_items" in the day vector. This may also be
the case for a recurring item.
The day_item structure has a member "start", which for day_items for
recurring appointments is set to the occurrence found by
recur_item_find_occurrence(), and is used to tell days of a multi-day
appointment apart.
For day_items for recurring events it was set to "day" of the
recur_event structure (the same value for all occurrences) and not used.
The value is now the occurrence found by recur_event_find_occurrence().
The patch is backwards compatible and future-proof.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
| |
The preselected item is not searched for if the range of days is changed
(day_changed = 1). The patch is meant to future-proof the
selected-item-algorithm and is backwards compatible.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
| |
Code duplication has been eliminated by calling update_rept() from the
repeat command ui_day_item_repeat().
The repeat command asks for simple or advanced repetition.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function update_rept() is extended with editing of the three
recurrence rule lists for BYMONTH, BYMONTHDAY and BYDAY.
The integers of the bymonth and bymonthday lists are edited directly as
integers, while those of the bywday list are mapped to localized weekday
names (as they appear in the calendar panel) with an optional integer
prefix (in RFC5545 style: 1MO, -2SA).
The RFC5545 (icalendar) requirement that the start day must be the first
occurrence and must match the recurrence rule, is met by testing that an
occurrence indeed appears on the start day, in these circumstances:
- when a recurrent item is loaded from file
- when the recurrence rule of an item is edited interactively
- when a recurrent appointment gets a new start time
- when a recurrent appointment is moved
Copy and paste of a recurrent item will only retain the basic recurrence
properties of type, frequency, until and exception days.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
| |
Test cases include all the examples from RFC5545 which are supported.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Terms and concepts are from RFC 5545 (the iCalendar specification).
Overall design
--------------
Calcurse is extended with full support for BYMONTH, BYDAY and BYMONTHDAY
recurrence rule (rrule) parts. The three rule parts are lists of,
respectively, months, weekdays and monthdays. The lists are added to
'struct rpt' as linked lists of integers, and the data file format is
extended accordingly (details below). Load and save of the lists follow
the pattern of the existing list of exception dates, also in 'struct
rpt'.
The function recur_item_find_occurence() is split into a front-end and a
back-end. The back-end, called find_occurrence(), is the original
function extended with rrule reductions; the front-end retains the
original name and performs rrule expansions. Front-end plus back-end are
backwards compatible and require no changes in calling functions.
There is no user interface in this patch.
Data file extensions
--------------------
The BYMONTH, BYDAY and BYMONTHDAY lists are added to that part of an
item line which describes the recurrence rule (the "{...}" part). Each
list is - like the list of exception days - a space-separated string of
values identified by the initial character. Each list is optional and,
if present, must follow the until date and precede the exception day
list. The lists must appear in order BYMONTHDAY list, BYDAY list and
BYMONTH list.
The possible list values are
- BYMONTH: m1, m2, ..., m12
- BYDAY: w0, w1, ..., w6, w7, w-7, w8, w-8, ..., w377, w-377
- BYMONTHDAY: d1, d2, ..., d31, d-1, d-2, ..., d-31
which are interpreted as (cf. RFC 5545)
- BYMONTH: January, February, ..., December.
- BYDAY: SU, MO, ..., SA, +1SU, -1SU, +1MO, -1MO, ..., +53SA, -53SA
- BYMONTHDAY: the first, the second, ..., the 31st, the last,
the last but one, ..., the last but 30 day of the month
Examples:
Thursday, TH, is w4; Saturday, SA, is w6.
The seventh Thursday, +7TH, is w53 (7 * 7 + 4 = 53); the last but second
Saturday, -2SA, is w-20 (2 * 7 + 6 = 20); the last day of the month is
d-1.
Note that the values w-1, w-2, ..., w-6 are not used.
A recurrent appointment with a BYDAY rule part:
06/23/2019 @ 12:00 -> 06/23/2019 @ 13:00 {1W w0 w6} |every week on Sunday and Saturday
An event with a BYDAY and a BYMONTH rule part:
10/27/2019 [1] {1Y w-7 m10} every year on last Sunday in October
An event with until date, a BYMONTH rule part and an exception day:
06/23/2019 [1] {1Y -> 08/31/2021 m5 m6 m7 !07/23/2020} every year on the 23rd in May, June and July for three years, starting on Sunday, 23 June 2019, but not on 23 July 2020.
Recurrence set expansion and reduction
---------------------------------------
In calcurse a recurrence rule is a quadruple (s, d, r, e) consisting of
start, duration, repetition pattern and exception days and is
implemented as:
(time_t start, long dur, struct rpt *rpt, llist_t *exc)
In RFC 5545 parlance, a recurrence rule defines a recurrence set
consisting of all recurrence instances (occurrences) not earlier than
start which match the rule pattern. With this concept in mind,
recur_item_find_occurremce() may be thought of as a membership function
for a recurrence set. The call
recur_item_find_occurrence(s, d, r, e, day, occurrence)
returns true if day belongs to the recurrence set of (s, d, r, e); if so
occurrence points to the recurrence instance (the set member).
For a recurrence rule with only the basic DAYLY, WEEKLY, MONTHLY or
YEARLY type and frequency the recurrence set consists of periodically
repeated instances. The BYxxx rule parts modify the recurrence set by
reducing or expanding it as specified by RFC 5545.
Expansion is implemented in the front-end by modifications of start
and/or frequency of the rule (s, d, r, e), often several times, in such
a way that the desired recurrence instances are included in the
recurrence set. This is possible because the front-end as the very first
thing checks for early days (day < s). When day is known not to be
early, start (s) can safely be moved backwards. Likewise, if frequency
must be changed, the front-end checks whether the frequency repetition
applies to the week, month or year of day.
Reduction is easier and is performed in the back-end along with the
existing validity checks. It consists in checking whether month, day of
month or weekday of a found occurrence is on the appropriate list.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch contains no functional changes, but is a necessary
precondition for extensions of update_rept() (in ui-day.c) with further
recurrence rules.
The reason is that recurrence parameters must be treated as a whole: if
an edit session is cancelled at any point, no value should change, and
all parameters should remain as they were. Hence, the new values must
only be set after all of them have been determined. This was not the
case for the list of exception days, but as long as it was treated last,
it did not matter.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
| |
The last part of loading appointments and events is performed by four
"scan" functions called from io_load_app(). Failure in this part of data
load does not use io_load_error().
The four "scan" functions are changed to return an error message on
failure and NULL otherwise (the previous return value was not used).
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The recurrence parameters are type, frequency, until date and exception
list (in RFC 5545 parlance FREQ, INTERVAL, UNTIL and EXDATE's). When
these are passed in a function call, the argument list becomes long and
not very readable. When support for extended recurrence rules is
implemented, the number of recurrence parameters increases, and function
signatures must be amended.
Solution: The "struct rpt" is extended with the exception list; any
future recurrence parameters are added here. A pointer to this structure
replaces the recurrence parameters in function calls.
Note: Each recurrent event and appoinment instance has (a pointer to) a
"struct rpt" and in addition an exception list. The latter is retained
to avoid the derived changes, and the exception list in the structure is
initialized to an empty list when the recurrent instance is created.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
Also, prepare for extension of the structure, shorten names and
rearrange comments.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
| |
iCal import to an item note file is extended from DESCRIPTION to
LOCATION, COMMENT and STATUS for both events and todos.
Addresses GitHub issue #9.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
Adresses GitHub issue #274.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
| |
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
| |
Tests ical-010.sh and ical-011.sh assume that Github issue #265 has been fixed
(escape-encoding by export).
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
| |
Stick strictly to RFC 5545, 3.3.11, Text, for SUMMARY and DESCRIPTION.
Adresses Github issue #271.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following issues have been fixed:
Functions ical_read_event() and ical_read__todo() do not check the return value
of functions which may fail, in which case an item is not skipped even though
a problem may have been logged by the called function.
Function ical_read_note() fails on empty DESCRIPTION, but does not log it.
Function ical_read_exdate() may log a failure, but cannot fail itself.
Function ical_read_summary() can fail, but not log a failure.
Function ical_read_todo() do not skip a todo with an invalid priority.
Additionally:
A safety check has been added to ical_get_value(), and log messages resulting
from failures have been made uniform.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
Todos were imported (and saved), but not loaded into the listbox for display.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
| |
The log file is not deleted if items were skipped (adresses Github issue #269).
The log file includes the import file name and time.
The import line numbers have been corrected (and tests amended).
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
Escape semicolons, commas, and backslashes when exporting a calendar
item to iCal format.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
| |
Register REG_BLACK_HOLE can neither be copied into nor pasted from and
has been removed from the input routine.
Register 36 was not used.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
| |
Ensure that calcurse uses the right data and configuration directories
depending on the conditions.
Helped-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
| |
* Use "$XDG_DATA_HOME/calcurse" for data files
* Use "$XDG_CONFIG_HOME/calcurse" for config files
* "$XDG_DATA_HOME" defaults to "$HOME/.local/share"
* "$XDG_CONFIG_HOME" defaults to "$HOME/.config"
* If "$HOME/.calcurse" exists, then it will be used instead for backward
compatibility.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|