(isoWeek, existingDate)
| 22277 | } |
| 22278 | |
| 22279 | function weekParser(isoWeek, existingDate) { |
| 22280 | if (isDate(isoWeek)) { |
| 22281 | return isoWeek; |
| 22282 | } |
| 22283 | |
| 22284 | if (isString(isoWeek)) { |
| 22285 | WEEK_REGEXP.lastIndex = 0; |
| 22286 | var parts = WEEK_REGEXP.exec(isoWeek); |
| 22287 | if (parts) { |
| 22288 | var year = +parts[1], |
| 22289 | week = +parts[2], |
| 22290 | hours = 0, |
| 22291 | minutes = 0, |
| 22292 | seconds = 0, |
| 22293 | milliseconds = 0, |
| 22294 | firstThurs = getFirstThursdayOfYear(year), |
| 22295 | addDays = (week - 1) * 7; |
| 22296 | |
| 22297 | if (existingDate) { |
| 22298 | hours = existingDate.getHours(); |
| 22299 | minutes = existingDate.getMinutes(); |
| 22300 | seconds = existingDate.getSeconds(); |
| 22301 | milliseconds = existingDate.getMilliseconds(); |
| 22302 | } |
| 22303 | |
| 22304 | return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); |
| 22305 | } |
| 22306 | } |
| 22307 | |
| 22308 | return NaN; |
| 22309 | } |
| 22310 | |
| 22311 | function createDateParser(regexp, mapping) { |
| 22312 | return function(iso, date) { |
nothing calls this directly
no test coverage detected