(isoWeek, existingDate)
| 22729 | } |
| 22730 | |
| 22731 | function weekParser(isoWeek, existingDate) { |
| 22732 | if (isDate(isoWeek)) { |
| 22733 | return isoWeek; |
| 22734 | } |
| 22735 | |
| 22736 | if (isString(isoWeek)) { |
| 22737 | WEEK_REGEXP.lastIndex = 0; |
| 22738 | var parts = WEEK_REGEXP.exec(isoWeek); |
| 22739 | if (parts) { |
| 22740 | var year = +parts[1], |
| 22741 | week = +parts[2], |
| 22742 | hours = 0, |
| 22743 | minutes = 0, |
| 22744 | seconds = 0, |
| 22745 | milliseconds = 0, |
| 22746 | firstThurs = getFirstThursdayOfYear(year), |
| 22747 | addDays = (week - 1) * 7; |
| 22748 | |
| 22749 | if (existingDate) { |
| 22750 | hours = existingDate.getHours(); |
| 22751 | minutes = existingDate.getMinutes(); |
| 22752 | seconds = existingDate.getSeconds(); |
| 22753 | milliseconds = existingDate.getMilliseconds(); |
| 22754 | } |
| 22755 | |
| 22756 | return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); |
| 22757 | } |
| 22758 | } |
| 22759 | |
| 22760 | return NaN; |
| 22761 | } |
| 22762 | |
| 22763 | function createDateParser(regexp, mapping) { |
| 22764 | return function(iso, date) { |
nothing calls this directly
no test coverage detected