(isoWeek, existingDate)
| 21728 | } |
| 21729 | |
| 21730 | function weekParser(isoWeek, existingDate) { |
| 21731 | if (isDate(isoWeek)) { |
| 21732 | return isoWeek; |
| 21733 | } |
| 21734 | |
| 21735 | if (isString(isoWeek)) { |
| 21736 | WEEK_REGEXP.lastIndex = 0; |
| 21737 | var parts = WEEK_REGEXP.exec(isoWeek); |
| 21738 | if (parts) { |
| 21739 | var year = +parts[1], |
| 21740 | week = +parts[2], |
| 21741 | hours = 0, |
| 21742 | minutes = 0, |
| 21743 | seconds = 0, |
| 21744 | milliseconds = 0, |
| 21745 | firstThurs = getFirstThursdayOfYear(year), |
| 21746 | addDays = (week - 1) * 7; |
| 21747 | |
| 21748 | if (existingDate) { |
| 21749 | hours = existingDate.getHours(); |
| 21750 | minutes = existingDate.getMinutes(); |
| 21751 | seconds = existingDate.getSeconds(); |
| 21752 | milliseconds = existingDate.getMilliseconds(); |
| 21753 | } |
| 21754 | |
| 21755 | return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); |
| 21756 | } |
| 21757 | } |
| 21758 | |
| 21759 | return NaN; |
| 21760 | } |
| 21761 | |
| 21762 | function createDateParser(regexp, mapping) { |
| 21763 | return function(iso, date) { |
nothing calls this directly
no test coverage detected