Lines Matching refs:mm
87 static int month_days(int yy, int mm)
91 if (mm == 2)
93 else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
101 static int week_day(int yy, int mm, int dd)
105 dd += mm < 3 ? yy-- : yy - 2;
106 wd = 23*mm/9 + dd + 4 + yy/4 - yy/100 + yy/400;
114 int *mm, int *dd)
119 *mm = MIN(*month, 12);
120 if (*mm == 0)
121 *mm = 1;
123 if (*dd > month_days(*yy, *mm))
124 *dd = month_days(*yy, *mm);
127 static void datectl(enum operation op, int *yy, int *mm, int *dd)
131 ndays = month_days(*yy, *mm);
138 if (*mm == 1) {
140 *mm = 12;
142 *mm -= 1;
143 ndays = month_days(*yy, *mm);
151 if (*mm == 12) {
153 *mm = 1;
155 *mm += 1;
163 if (*mm == 1) {
165 *mm = 12;
167 *mm -= 1;
168 *dd = month_days(*yy, *mm);
175 if (*mm == 12) {
177 *mm = 1;
179 *mm += 1;
184 if (*mm == 1) {
185 *mm = 12;
188 *mm -= 1;
189 ndays = month_days(*yy, *mm);
194 if (*mm == 12) {
195 *mm = 1;
198 *mm += 1;
199 ndays = month_days(*yy, *mm);
205 ndays = month_days(*yy, *mm);
211 ndays = month_days(*yy, *mm);
219 *mm = 1;
224 *mm = 12;
258 print_calendar(struct bsddialog_conf *conf, WINDOW *win, int yy, int mm, int dd,
276 ndays = month_days(yy, mm);
278 wd = week_day(yy, mm, 1);
333 int retval, sel, yy, mm, dd;
343 init_date(year, month, day, &yy, &mm, &dd);
352 RETURN_ERROR("Cannot build WINDOW for mm");
363 drawsquare(conf, mm_win, RAISED, "%15s", mm, sel == 0);
365 print_calendar(conf, dd_win, yy, mm, dd, sel == 2);
414 datectl(RIGHT_DAY, &yy, &mm, &dd);
431 datectl(LEFT_DAY, &yy, &mm, &dd);
448 datectl(UP_MONTH, &yy, &mm, &dd);
450 datectl(UP_YEAR, &yy, &mm, &dd);
452 datectl(UP_DAY, &yy, &mm, &dd);
459 datectl(DOWN_MONTH, &yy, &mm, &dd);
461 datectl(DOWN_YEAR, &yy, &mm, &dd);
463 datectl(DOWN_DAY, &yy, &mm, &dd);
470 datectl(UP_MONTH, &yy, &mm, &dd);
472 datectl(UP_YEAR, &yy, &mm, &dd);
474 datectl(LEFT_DAY, &yy, &mm, &dd);
481 datectl(DOWN_MONTH, &yy, &mm, &dd);
483 datectl(DOWN_YEAR, &yy, &mm, &dd);
485 datectl(RIGHT_DAY, &yy, &mm, &dd);
489 datectl(UP_MONTH, &yy, &mm, &dd);
492 datectl(DOWN_MONTH, &yy, &mm, &dd);
495 datectl(UP_YEAR, &yy, &mm, &dd);
498 datectl(DOWN_YEAR, &yy, &mm, &dd);
525 *month = mm;
567 build_dateitem(const char *format, int *yy, int *mm, int *dd,
574 {UP_MONTH, DOWN_MONTH, NULL, 11, "%9s", mm},
610 int retval, i, sel, yy, mm, dd;
620 init_date(year, month, day, &yy, &mm, &dd);
625 if (build_dateitem(conf->date.format, &yy, &mm, &dd, di) != 0)
695 datectl(di[sel].up, &yy, &mm, &dd);
704 datectl(di[sel].up, &yy, &mm, &dd);
711 datectl(di[sel].down, &yy, &mm, &dd);
738 *month = mm;