Show week numbers in the monthly view

Suggested-by: Håkan Jerning <jerning@home.se>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2015-04-10 09:45:04 +02:00
parent ebb8116056
commit 7fea5451ad

View File

@ -394,6 +394,7 @@ draw_monthly_view(struct scrollwin *sw, struct date *current_day,
unsigned yr, mo; unsigned yr, mo;
int w, ofs_x, ofs_y; int w, ofs_x, ofs_y;
int item_this_day = 0; int item_this_day = 0;
struct tm t = get_first_weekday(sunday_first);
mo = slctd_day.mm; mo = slctd_day.mm;
yr = slctd_day.yyyy; 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) - (int)((ymd_to_scalar(yr, mo, 1 + sunday_first) -
(long)1) % 7L); (long)1) % 7L);
/* Print the week number. */
draw_week_number(sw, t);
/* Write the current month and year on top of the calendar */ /* Write the current month and year on top of the calendar */
WINS_CALENDAR_LOCK; WINS_CALENDAR_LOCK;
if (yr * YEARINMONTHS + mo != monthly_view_cache_month) { if (yr * YEARINMONTHS + mo != monthly_view_cache_month) {