Lines Matching defs:week
44 * type is week type
45 * 0 sunday first day of week
46 * 1 monday first day of week
47 * 2 monday first day of iso week
48 * if week<0 then return week for tm
49 * if day<0 then set tm to first day of week
50 * otherwise set tm to day in week
55 tmweek(Tm_t* tm, int type, int week, int day)
59 if (week < 0)
63 week = (tm->tm_yday + offset[day][type]) / 7;
66 if (!week)
67 week = (day > 0 && day < 6 || tmisleapyear(tm->tm_year - 1)) ? 53 : 52;
68 else if (week == 53 && (tm->tm_wday + (31 - tm->tm_mday)) < 4)
69 week = 1;
71 return week;
79 tm->tm_mday = week * 7 - offset[d][type] + ((day || type != 2) ? day : 7);