Home | History | Annotate | Download | only in util

Lines Matching refs:YEAR

38      * When parsing a date without a year, the system assumes 1970, which wasn't a leap-year.
39 * Let's add a one-off hack for that day of the year
67 * @param mustContainYear If true, the string is parsed as a date containing a year. If false,
68 * the string is parsed into a valid date even if the year field is missing.
108 calendar.set(Calendar.YEAR, 0);
113 private static final Calendar getUtcDate(int year, int month, int dayOfMonth) {
116 calendar.set(Calendar.YEAR, year);
123 // use the Calendar.YEAR field to track whether or not the year is set instead of
126 return cal.get(Calendar.YEAR) > 1;
198 * Returns a SimpleDateFormat object without the year fields by using a regular expression
199 * to eliminate the year in the string pattern. In the rare occurence that the resulting
207 // Determine the correct regex pattern for year.
212 // Eliminate the substring in pattern that matches the format for that of year
221 * Given a calendar (possibly containing only a day of the year), returns the earliest possible
223 * does not contain a year, or the date converted to the local time zone (if the date contains
224 * a year.
227 * @return If date does not contain a year (year < 1900), returns the next earliest anniversary
243 final int targetYear = target.get(Calendar.YEAR);
248 // Convert from the UTC date to the local date. Set the year to today's year if the
249 // there is no provided year (targetYear < 1900)
250 anniversary.set(!isYearSet ? today.get(Calendar.YEAR) : targetYear,
252 // If the anniversary's date is before the start of today and there is no year set,
253 // increment the year by 1 so that the returned date is always equal to or greater than
254 // today. If the day is a leap year, keep going until we get the next leap year anniversary
255 // Otherwise if there is already a year set, simply return the exact date.
257 int anniversaryYear = today.get(Calendar.YEAR);
260 // If the target date is not Feb 29, then set the anniversary to the next year.
261 // Otherwise, keep going until we find the next leap year (this is not guaranteed