Lines Matching refs:month

204                         iterator.month + 1);
321 * Compute the day of the week for the first day of the month. "instance" has a
326 * (day of the month - 1) mod 7, and then make sure it's positive. We can simplify
341 * Generate a set according to the BYDAY rules. For each day of the month, determine
349 // For each month day, see if it's part of the set. (This makes some assumptions
433 int realMonth = iterator.month;
439 + " " + iterator.month
444 // if might be past the end of the month, we need to normalize it
449 realMonth = t.month;
452 Log.i(TAG, "normalized t=" + t + " " + t.month
469 Log.i(TAG, "set t=" + t + " " + t.month
486 * Fill in a bit set containing the days of the month on which this
509 // calculate the day of week for the first of this month (first)
522 // This isn't ideal, but we'll generate a month's worth of events
534 // v is 0, each day in the month/week
542 // v is positive, count from the beginning of the month
553 // v is negative, count from the end of the month
670 // them to year/month/day values in the local timezone.
685 // them to year/month/day values in the local timezone.
698 // for fast comparisons and that is easy to generate from year/month/day
847 // We need the "until" year/month/day values to be in the same
880 int iteratorMonth = iterator.month + 1;
891 do { // month
892 int month = usebymonth
895 month--;
896 if (SPEW) Log.i(TAG, " month=" + month);
901 // Use this to handle weeks that overlap the end of the month.
902 // Keep the year and month that days is for, and generate it
978 // month advancing extra times, as we set the month to the 32nd, 33rd, etc.
980 generated.set(second, minute, hour, day, month, iteratorYear);
1067 // per month
1087 iterator.month += value;
1143 int month = date.month;
1160 // If month is after Feb, then add this year's length so that we
1162 // Otherwise (the month is Feb or earlier), add last year's length.
1164 // effective date but makes monthDay (the day of the month) much
1167 int days = month > 1 ? yearLength(year) : yearLength(year - 1);
1171 // At this point, monthDay >= 1. Normalize the month to the range [0,11].
1172 if (month < 0) {
1173 int years = (month + 1) / 12 - 1;
1175 month -= 12 * years;
1176 } else if (month >= 12) {
1177 int years = month / 12;
1179 month -= 12 * years;
1181 // At this point, month is in the range [0,11] and monthDay >= 1.
1182 // Now loop until the monthDay is in the correct range for the month.
1185 if (month == 0) {
1192 int monthLength = monthLength(year, month);
1195 month++;
1196 if (month >= 12) {
1197 month -= 12;
1202 // At this point, monthDay <= the length of the current month and is
1209 date.month = month;
1211 date.weekDay = weekDay(year, month, monthDay);
1212 date.yearDay = yearDay(year, month, monthDay);
1241 * Returns the number of days in the given month of the given year.
1244 * @param month the given month in the range [0,11]
1245 * @return the number of days in the given month of the given year.
1247 static int monthLength(int year, int month) {
1248 int n = DAYS_PER_MONTH[month];
1257 * the given year, month, and day.
1260 * @param month the 0-based month in the range [0,11]
1261 * @param day the 1-based day of the month in the range [1,31]
1264 static int weekDay(int year, int month, int day) {
1265 if (month <= 1) {
1266 month += 12;
1269 return (day + (13 * month - 14) / 5 + year + year/4 - year/100 + year/400) % 7;
1273 * Computes the 0-based "year day", given the year, month, and day.
1276 * @param month the 0-based month in the range [0,11]
1280 static int yearDay(int year, int month, int day) {
1281 int yearDay = DAYS_IN_YEAR_PRECEDING_MONTH[month] + day - 1;
1282 if (month >= 2 && isLeapYear(year)) {
1301 // 37 bits for the year, 4 bits for the month, 5 bits for the monthDay,
1303 return ((long)normalized.year << 26) + (normalized.month << 22)
1310 date.month = (int) (val >> 22) & 0xf;