summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2015-04-11 10:37:54 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2015-04-11 10:37:54 +0200
commit776ef240755fc86222dfa412e2411791576fb90e (patch)
treece6d455ceb042cb1288a3996189cffcdd622d935 /src
parentd354a4a05d1f280a3ab4e011b7f954c409a3229e (diff)
downloadcalcurse-776ef240755fc86222dfa412e2411791576fb90e.tar.gz
calcurse-776ef240755fc86222dfa412e2411791576fb90e.zip
Do not mark slice of end time busy
In weekly view, when computing busy slices, do not fill a slot that is only hit by the end time of an appointment. Suggested-by: HÃ¥kan Jerning <jerning@home.se> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src')
-rw-r--r--src/day.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/day.c b/src/day.c
index 75719a6..0391548 100644
--- a/src/day.c
+++ b/src/day.c
@@ -582,8 +582,15 @@ unsigned day_chk_busy_slices(struct date day, int slicesno, int *slices)
else
end = DAYINSEC - 1;
- if (!fill_slices
- (slices, slicesno, SLICENUM(start), SLICENUM(end))) {
+ /*
+ * If an item ends on 12:00, we do not want the 12:00 slot to
+ * be marked busy.
+ */
+ if (end > start)
+ end--;
+
+ if (!fill_slices(slices, slicesno, SLICENUM(start),
+ SLICENUM(end))) {
LLIST_TS_UNLOCK(&recur_alist_p);
return 0;
}
@@ -603,8 +610,15 @@ unsigned day_chk_busy_slices(struct date day, int slicesno, int *slices)
if (apt->start + apt->dur >= t + DAYINSEC)
end = DAYINSEC - 1;
- if (!fill_slices
- (slices, slicesno, SLICENUM(start), SLICENUM(end))) {
+ /*
+ * If an item ends on 12:00, we do not want the 12:00 slot to
+ * be marked busy.
+ */
+ if (end > start)
+ end--;
+
+ if (!fill_slices(slices, slicesno, SLICENUM(start),
+ SLICENUM(end))) {
LLIST_TS_UNLOCK(&alist_p);
return 0;
}