(isoWeek, existingDate)
| 26650 | } |
| 26651 | |
| 26652 | function weekParser(isoWeek, existingDate) { |
| 26653 | if (isDate(isoWeek)) { |
| 26654 | return isoWeek; |
| 26655 | } |
| 26656 | |
| 26657 | if (isString(isoWeek)) { |
| 26658 | WEEK_REGEXP.lastIndex = 0; |
| 26659 | var parts = WEEK_REGEXP.exec(isoWeek); |
| 26660 | if (parts) { |
| 26661 | var year = +parts[1], |
| 26662 | week = +parts[2], |
| 26663 | hours = 0, |
| 26664 | minutes = 0, |
| 26665 | seconds = 0, |
| 26666 | milliseconds = 0, |
| 26667 | firstThurs = getFirstThursdayOfYear(year), |
| 26668 | addDays = (week - 1) * 7; |
| 26669 | |
| 26670 | if (existingDate) { |
| 26671 | hours = existingDate.getHours(); |
| 26672 | minutes = existingDate.getMinutes(); |
| 26673 | seconds = existingDate.getSeconds(); |
| 26674 | milliseconds = existingDate.getMilliseconds(); |
| 26675 | } |
| 26676 | |
| 26677 | return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); |
| 26678 | } |
| 26679 | } |
| 26680 | |
| 26681 | return NaN; |
| 26682 | } |
| 26683 | |
| 26684 | function createDateParser(regexp, mapping) { |
| 26685 | return function(iso, previousDate) { |
nothing calls this directly
no test coverage detected