(isoWeek, existingDate)
| 25667 | } |
| 25668 | |
| 25669 | function weekParser(isoWeek, existingDate) { |
| 25670 | if (isDate(isoWeek)) { |
| 25671 | return isoWeek; |
| 25672 | } |
| 25673 | |
| 25674 | if (isString(isoWeek)) { |
| 25675 | WEEK_REGEXP.lastIndex = 0; |
| 25676 | var parts = WEEK_REGEXP.exec(isoWeek); |
| 25677 | if (parts) { |
| 25678 | var year = +parts[1], |
| 25679 | week = +parts[2], |
| 25680 | hours = 0, |
| 25681 | minutes = 0, |
| 25682 | seconds = 0, |
| 25683 | milliseconds = 0, |
| 25684 | firstThurs = getFirstThursdayOfYear(year), |
| 25685 | addDays = (week - 1) * 7; |
| 25686 | |
| 25687 | if (existingDate) { |
| 25688 | hours = existingDate.getHours(); |
| 25689 | minutes = existingDate.getMinutes(); |
| 25690 | seconds = existingDate.getSeconds(); |
| 25691 | milliseconds = existingDate.getMilliseconds(); |
| 25692 | } |
| 25693 | |
| 25694 | return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); |
| 25695 | } |
| 25696 | } |
| 25697 | |
| 25698 | return NaN; |
| 25699 | } |
| 25700 | |
| 25701 | function createDateParser(regexp, mapping) { |
| 25702 | return function(iso, date) { |
nothing calls this directly
no test coverage detected