From 7fea5451ade0c7d534d3c9190b2152b836caae6e Mon Sep 17 00:00:00 2001
From: Lukas Fleischer <calcurse@cryptocrack.de>
Date: Fri, 10 Apr 2015 09:45:04 +0200
Subject: Show week numbers in the monthly view
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Suggested-by: HÃ¥kan Jerning <jerning@home.se>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
---
 src/ui-calendar.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/ui-calendar.c b/src/ui-calendar.c
index 6bc1b0f..7854048 100644
--- a/src/ui-calendar.c
+++ b/src/ui-calendar.c
@@ -394,6 +394,7 @@ draw_monthly_view(struct scrollwin *sw, struct date *current_day,
 	unsigned yr, mo;
 	int w, ofs_x, ofs_y;
 	int item_this_day = 0;
+	struct tm t = get_first_weekday(sunday_first);
 
 	mo = slctd_day.mm;
 	yr = slctd_day.yyyy;
@@ -416,6 +417,9 @@ draw_monthly_view(struct scrollwin *sw, struct date *current_day,
 	    (int)((ymd_to_scalar(yr, mo, 1 + sunday_first) -
 		   (long)1) % 7L);
 
+	/* Print the week number. */
+	draw_week_number(sw, t);
+
 	/* Write the current month and year on top of the calendar */
 	WINS_CALENDAR_LOCK;
 	if (yr * YEARINMONTHS + mo != monthly_view_cache_month) {
-- 
cgit v1.2.3-70-g09d2