(isoWeek, existingDate)
| 25810 | } |
| 25811 | |
| 25812 | function weekParser(isoWeek, existingDate) { |
| 25813 | if (isDate(isoWeek)) { |
| 25814 | return isoWeek; |
| 25815 | } |
| 25816 | |
| 25817 | if (isString(isoWeek)) { |
| 25818 | WEEK_REGEXP.lastIndex = 0; |
| 25819 | var parts = WEEK_REGEXP.exec(isoWeek); |
| 25820 | if (parts) { |
| 25821 | var year = +parts[1], |
| 25822 | week = +parts[2], |
| 25823 | hours = 0, |
| 25824 | minutes = 0, |
| 25825 | seconds = 0, |
| 25826 | milliseconds = 0, |
| 25827 | firstThurs = getFirstThursdayOfYear(year), |
| 25828 | addDays = (week - 1) * 7; |
| 25829 | |
| 25830 | if (existingDate) { |
| 25831 | hours = existingDate.getHours(); |
| 25832 | minutes = existingDate.getMinutes(); |
| 25833 | seconds = existingDate.getSeconds(); |
| 25834 | milliseconds = existingDate.getMilliseconds(); |
| 25835 | } |
| 25836 | |
| 25837 | return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); |
| 25838 | } |
| 25839 | } |
| 25840 | |
| 25841 | return NaN; |
| 25842 | } |
| 25843 | |
| 25844 | function createDateParser(regexp, mapping) { |
| 25845 | return function(iso, previousDate) { |
nothing calls this directly
no test coverage detected