const char *full_month[MONTHS_IN_YEAR]; /* month names */
int colormode; /* day and week number highlight */
int num_months; /* number of requested mounths */
+ int span_months; /* span the date */
int months_in_row; /* number of months horizontally in print out */
int weekstart; /* day the week starts, often Sun or Mon */
int weektype; /* WEEK_TYPE_{NONE,ISO,US} */
static struct cal_control ctl = {
.weekstart = SUNDAY,
.num_months = 1, /* default is "cal -1" */
+ .span_months = 0,
.colormode = UL_COLORMODE_UNDEF,
.weektype = WEEK_NUM_DISABLED,
.day_width = DAY_LEN,
break;
case '3':
ctl.num_months = 3;
+ ctl.span_months = 1;
ctl.months_in_row = 3;
break;
case 's':
int32_t year = ctl->req.year;
/* cal -3 */
- if (ctl->num_months == 3 && ctl->months_in_row == 3) {
+ if (ctl->num_months == 3 && ctl->span_months) {
if (month == 1){
month = MONTHS_IN_YEAR;
year--;