| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
Explicit setting of Daylight Saving Time should be avoided before as well as
after the mktime() call.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
| |
Since commit 987fa9d (Allow to omit end date in repetitions,
2019-06-03), one can provide an empty date instead of using the value 0
to omit the end date of a repetition. Use this as default value when
editing repetitions without an end date.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
| |
A scrollbar gives the impression of a fixed list. But the list on
display is automatically and silently changed as needed for movements in
the panel or the calendar, thus creating the illusion of an endless
list.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, with only one day visible at a time, the appointments panel
displayed the details of the day selected in the calendar (slctd_day);
information required for operations on items (day_items) can often be
derived from the selected day. The items available are derived from the
selected day. In particular, the selected item is derived from the
selected day.
With multiple days in the APP panel, the relation between selected day
(in the calendar) and the selected item (in the APP panel) has, in a
way, been turned around. The selected item may now be moved between days
without explicitly changing the selected day. Implicitly it is changed
when the target day of a move is unavailable.
This commit draws the full consequence: the selected day in the calendar
is always (set to) the day of the selected item in the APP panel.
The static variable 'struct date slctd_day' lives in ui_calendar.c and
is accessible through various public functions. To these are added
ui_calendar_set_slctd_day() which sets slctd_day directly.
The selected day retains its significance for load of the day vector (in
day_store_items()): the range of loaded days begins with the selected
day. Movements (up/down) in the APP panel will change the selected day
as the selected item moves among the already loaded days. Only when the
target of a movement is unreachable, will further days be loaded. On the
other hand, if the same range of days must be reloaded because of a
changed item, the selected item - and with it the selected day - must be
reset to the first day item (see do_storage()).
Movements in the calendar (generic-next-day, etc.) are not affected and
behave as previously, i.e. they will cause a range of days to be loaded
with the selected day as the first and the selected item as the first of
the selected day.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Much in the calendar is based on the selected day, struct date
slctd_day, in ui-calendar.c.
On the screen it is highlighted with a deviating colour. The highlight
effect has been changed to a pair of red square brackets that do not
obscure the day colour.
The week number (in the frame) used to be that of the selected day, but
has no obvious relation to the days in the APP panel. It has been
replaced by the year day number of the selected day. The week numbers of
all visible weeks are displayed to the left of the calendar.
Dates are displayed also for the overlapping parts of the first and last
week of the month (which do not belong to the month).
Days are accessible in the appointments panel as well as in the
calendar. Hence, validation of days (= inside UNIX time limits) must be
extended from the calendar (in ui_calendar_move()) to include loaded
days (in day_store_items()).
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
| |
The function day_process_storage() is a wrapper for day_store_items().
It has an unused second argument, and is only used twice to load the
selected day. It has been removed.
A new function, get_slctd_day(), is the equivalant of get_today() and
replaces the very awkwardly named ui_calendar_get_slctd_day_sec().
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
Included is a check of the 'until' date for pasted recurrent items.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
| |
In print_date(date, day, ...) it is silently assumed that day is
midnight (beginning) of the day to be printed. Assume only that it
belongs to the day.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Calcurse saves time and date information on disk as local time in readable text
file format. When loaded from disk or when entered by the user, local time is
converted to Unix time (seconds since 00:00:00, 1 January 1970). When
displayed, and later when saved to disk, the Unix time is converted back to
readable local time. Both conversions depend on DST.
Hence, if midnight for a day with DST in effect (i.e. local time) is converted,
increased with an amount and converted back, the amount has changed if DST is
_not_ in effect for the resulting time. In general, calculations on Unix time
variables should be used with caution because of the DST-dependent conversions.
Instead, the calculations should be performed on local time data with the help
of mktime().
The commit fixes start time for pasted appointments (ordinary and recurrent)
and the 'until'-date of recurrent appointments, pasted as well as new and
edited. The latter problem is slightly different in that the adjustment is a
number of days, as it is for exception dates.
Update of the date in parse_datetime() has been corrected to be similar to
update of the time, although no problem has been identified.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
| |
A new apppoint inserted on the day when the clock is adjusted backward by an
hour got a wrong start time (an hour late). Reason: mktime() must not use the
Daylight Saving Time information returned by localtime_r().
Also editorial simplifications.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
| |
Comments inserted.
Slightly different implementations of parse_time() and parse_datetime().
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
| |
All appointment times are checked for validity. Overflow by time
arithmetic is detected. End times are checked when appointments
are moved. Three functions are involved: parse_datetime(),
parse_duration() and parse_date_duration(); they all have a
new argument for validation purposes.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
| |
check_sec(), overflow_add(), overflow_mul()
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
| |
Translations (in po-files) of texts that are used for alternative
choices (e.g. [dwmy]), may use UTF-8 encoded Unicode characters (e.g.
[éãüå]).
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a scrollbar is on display in APP or TOD windows, the right
vertical border (outside the scrollbar) is not highlighted
when the window is selected.
The scrollbar is always highlighted:
- when APP or TOD is deselected
- in configuration windows where borders otherwise are not
The patch moves the scrollbar parameters (except highlight)
from arguments of draw_scrollbar() to the function itself.
The highlight argument was 1; instead it is set higher in
the call hierarchy (wins_update_panels()) and passed on down.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a scrollbar is on display in APP or TOD windows, the right
vertical border (outside the scrollbar) is not highlighted
when the window is selected.
The scrollbar itself is always highlighted:
- when APP or TOD is deselected
- in configuration windows where borders otherwise are not
The patch moves the scrollbar parameters from arguments of
draw_scrollbar() to the function itself.
The highlight argument to draw_scrollbar() was always 1.
Instead call circumstances are figured out and highlight set
accordingly.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the default colour setup (white on black), white could only
with great difficulty be used as customized foreground colour,
because the colour pair COLR_CUSTOM then was identical to
COLR_DEFAULT (default on default). This made it impossible to
distinguish the selected element in lists.
The patch turns on the video attribute bold when default is chosen
as foreground colour.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reintroduce year check for systems with a 32-bit time_t type. Remove the
lower limit (1902) for systems with a 64-bit time_t. This limits
movements in the calendar (for 32-bit systems) and in no way ensures
constistency of data.
Commit a12833e (Handle dates past January 19th, 2038, 2015-01-19)
removed the upper limit (2037) on dates but left the lower limit (1902).
It did not ensure the support of the target system.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
| |
Make sure that in cases when the date and time formats conflict, such as
is the case with "0030", the input is interpreted as a time value, not a
date.
Suggested-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
| |
In parse_datetime() it was possible to enter any number of dates and
times in any order. Allow just date or time or date followed by time.
Time must be looked for before date because of conflicting time and date
formats.
Suggested-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
| |
Add a wrapper around parse_date() which picks the current input date
format as well as the currently selected day and passes both values to
parse_date(), alongside with the parameters passed to
parse_date_interactive() itself.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
| |
The computation never really worked before and it seems like the feature
is not very helpful, sometimes even confusing (see GitHub issue #21).
The macro ISLEAP is moved to calcurse.h.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
Introduce a new function keys_wait_for_any_key() and use it instead of
wgetch() whenever the return value is discarded.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
When adding a key already in use for another action, a warning box is
displayed. The text length is limited by the window width through the
use of strncpy(). If the limit is exceeded, the string will have no null
termination, resulting in unpredictable behaviour.
A similar problem in fatalbox() is fixed as well.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
| |
Fixes GitHub issue #36.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
Remove the magic constants used in the return value of parse_datetime()
and use named flags instead.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
| |
Add support for combined date/time or date-only strings when specifying
the start or end time of a new item.
This is a follow-up to 1f39b5c (Add support for moving items to another
day, 2016-09-30).
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
| |
Create a new function that takes a time stamp and updates the date or
time components of that time stamp according to a given date/time
string. Use that function for updating the start time of an item.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
This prevents from notification bar artifacts being drawn after leaving
interactive mode.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
| |
Make that date membership is computed correctly, even if a day has less
than 86400 seconds (e.g. after changing clocks).
Reported-by: Hakan Jerning <jerning@home.se>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
When spending the end date of recurring items, allow date duration
specifiers such as "+5d" or "+3w2d".
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
| |
Parse durations containing decimal numbers (such as "1.5h") gracefully.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
| |
Actually print the hash instead of raw object data.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
| |
Split io_save_{apts,todo}() into functions that write raw data to a file
and functions that write formatted items to stdout such that one can
easily extend the grep mode for format string support in a follow-up
commit.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
Implement a -q/--quiet command line option to disable system dialogs
temporarily.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
| |
Implement a new --filter-hash option to filter by object identifiers.
Each object having an identifier that has the specified pattern as a
prefix is matched. Patterns starting with an exclamation mark (!) are
interpreted as negative patterns.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
Add new format specifiers to print the raw item representation or an
object's hash value.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
| |
Use the new string implementation to simplify asprintf().
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
This allows for easily adding week numbers to other panel modes, such as
the monthly view.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
Start converting some variables and return values to store times from
long to time_t.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
| |
Create user-defined functions to check whether a string contains a
certain prefix instead of messing around with strncmp() and
strncasecmp().
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to the iCal standard (4.3.12 Time):
UTC time, or absolute time, is identified by a LATIN CAPITAL LETTER
Z suffix character (US-ASCII decimal 90), the UTC designator,
appended to the time value.
Parse such time values properly when importing iCal files.
Fixes GitHub issue #3.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|