diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2015-04-11 10:37:54 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2015-04-11 10:37:54 +0200 |
commit | 776ef240755fc86222dfa412e2411791576fb90e (patch) | |
tree | ce6d455ceb042cb1288a3996189cffcdd622d935 | |
parent | d354a4a05d1f280a3ab4e011b7f954c409a3229e (diff) | |
download | calcurse-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>
-rw-r--r-- | src/day.c | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -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; } |