viscal

cairo/gtk vi-like timeblocking calendar
git clone git://jb55.com/viscal
Log | Files | Refs | README | LICENSE

commit 12f57bcb0676479f412c294e8ef281411c828d63
parent b77f6a71e99646a22bfaa32f362faf4d821d98e0
Author: William Casarin <jb55@jb55.com>
Date:   Tue, 21 Aug 2018 19:41:59 -0700

mod 24 for time margin

Diffstat:
Mviscal.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/viscal.c b/viscal.c @@ -113,7 +113,6 @@ static void calendar_create(struct cal *cal) { time_t now; time_t today; - cal->start_at = 60*60*8; struct tm nowtm; now = time(NULL); @@ -126,6 +125,7 @@ calendar_create(struct cal *cal) { cal->minute_round = 30; cal->ncalendars = 0; cal->nevents = 0; + cal->start_at = 5*60*60; cal->today = today; cal->x = g_lmargin; cal->y = cal->gutter_height; @@ -741,7 +741,7 @@ draw_hours (cairo_t *cr, struct cal* cal) cairo_set_dash (cr, NULL, 0, 0); if (onhour) { - format_margin_time(buffer, 32, minutes / 60); + format_margin_time(buffer, 32, (minutes / 60) % 24); // TODO: text extents for proper time placement? cairo_move_to(cr, g_lmargin - (g_margin_time_w + EVPAD), y+TXTPAD);