| 112 | } |
| 113 | |
| 114 | DateValue DateValue::CreateFromIso8601WeekBasedDateVals(int year, |
| 115 | int week_of_year, int day_of_week) { |
| 116 | if (year >= MIN_YEAR && year <= MAX_YEAR |
| 117 | && week_of_year >= 1 && week_of_year <= 53 |
| 118 | && 1 <= day_of_week && day_of_week <= 7) { |
| 119 | const cctz::civil_day first_monday = GetFirstIso8601MondayOfYear(year); |
| 120 | const cctz::civil_day last_sunday = GetLastIso8601SundayOfYear(year); |
| 121 | |
| 122 | const cctz::civil_day today = first_monday + (week_of_year - 1) * 7 + day_of_week - 1; |
| 123 | if (today <= last_sunday) return DateValue(today - EPOCH_DATE); |
| 124 | } |
| 125 | return DateValue(); |
| 126 | } |
| 127 | |
| 128 | DateValue DateValue::ParseSimpleDateFormat(const char* str, int len, |
| 129 | bool accept_time_toks) { |
nothing calls this directly
no test coverage detected