(isoWeek, existingDate)
| 21506 | } |
| 21507 | |
| 21508 | function weekParser(isoWeek, existingDate) { |
| 21509 | if (isDate(isoWeek)) { |
| 21510 | return isoWeek; |
| 21511 | } |
| 21512 | |
| 21513 | if (isString(isoWeek)) { |
| 21514 | WEEK_REGEXP.lastIndex = 0; |
| 21515 | var parts = WEEK_REGEXP.exec(isoWeek); |
| 21516 | if (parts) { |
| 21517 | var year = +parts[1], |
| 21518 | week = +parts[2], |
| 21519 | hours = 0, |
| 21520 | minutes = 0, |
| 21521 | seconds = 0, |
| 21522 | milliseconds = 0, |
| 21523 | firstThurs = getFirstThursdayOfYear(year), |
| 21524 | addDays = (week - 1) * 7; |
| 21525 | |
| 21526 | if (existingDate) { |
| 21527 | hours = existingDate.getHours(); |
| 21528 | minutes = existingDate.getMinutes(); |
| 21529 | seconds = existingDate.getSeconds(); |
| 21530 | milliseconds = existingDate.getMilliseconds(); |
| 21531 | } |
| 21532 | |
| 21533 | return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); |
| 21534 | } |
| 21535 | } |
| 21536 | |
| 21537 | return NaN; |
| 21538 | } |
| 21539 | |
| 21540 | function createDateParser(regexp, mapping) { |
| 21541 | return function(iso, date) { |
nothing calls this directly
no test coverage detected