summaryrefslogtreecommitdiff
path: root/src/args.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2015-02-22 11:32:20 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2015-02-22 11:34:11 +0100
commit7a631b2b63a040b1442feda435a0e9ac7e80774f (patch)
treeb6b0c95ef8600282c17b730f66507e1304dcc78f /src/args.c
parenta6c73232a8ffeed7c58dd45b766e241f8ec59d25 (diff)
downloadcalcurse-7a631b2b63a040b1442feda435a0e9ac7e80774f.zip
Use date_sec_change() for adding day deltas
Fixes tests range-002.sh and search-001.sh. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/args.c')
-rw-r--r--src/args.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/args.c b/src/args.c
index e600cc2..471c9ab 100644
--- a/src/args.c
+++ b/src/args.c
@@ -252,7 +252,7 @@ static void next_arg(void)
const long current_time = now();
int time_left, hours_left, min_left;
- next_app.time = current_time + DAYINSEC;
+ next_app.time = date_sec_change(current_time, 0, 1);
next_app.got_app = 0;
next_app.txt = NULL;
@@ -297,7 +297,7 @@ date_arg_from_to(long from, long to, int add_line, const char *fmt_apt,
{
long date;
- for (date = from; date < to; date += DAYINSEC) {
+ for (date = from; date < to; date = date_sec_change(date, 0, 1)) {
day_store_items(date, 0);
if (day_item_count(0) == 0)
continue;
@@ -729,9 +729,9 @@ int parse_args(int argc, char **argv)
}
if (to == -1 && range == -1)
- to = from + DAYINSEC;
+ to = date_sec_change(from, 0, 1);
else if (to == -1 && range >= 0)
- to = from + range * DAYINSEC;
+ to = date_sec_change(from, 0, range);
else if (to >= 0 && range >= 0)
EXIT_IF(to >= 0, _("cannot specify a range and an end date"));