(isoWeek, existingDate)
| 25303 | } |
| 25304 | |
| 25305 | function weekParser(isoWeek, existingDate) { |
| 25306 | if (isDate(isoWeek)) { |
| 25307 | return isoWeek; |
| 25308 | } |
| 25309 | |
| 25310 | if (isString(isoWeek)) { |
| 25311 | WEEK_REGEXP.lastIndex = 0; |
| 25312 | var parts = WEEK_REGEXP.exec(isoWeek); |
| 25313 | if (parts) { |
| 25314 | var year = +parts[1], |
| 25315 | week = +parts[2], |
| 25316 | hours = 0, |
| 25317 | minutes = 0, |
| 25318 | seconds = 0, |
| 25319 | milliseconds = 0, |
| 25320 | firstThurs = getFirstThursdayOfYear(year), |
| 25321 | addDays = (week - 1) * 7; |
| 25322 | |
| 25323 | if (existingDate) { |
| 25324 | hours = existingDate.getHours(); |
| 25325 | minutes = existingDate.getMinutes(); |
| 25326 | seconds = existingDate.getSeconds(); |
| 25327 | milliseconds = existingDate.getMilliseconds(); |
| 25328 | } |
| 25329 | |
| 25330 | return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); |
| 25331 | } |
| 25332 | } |
| 25333 | |
| 25334 | return NaN; |
| 25335 | } |
| 25336 | |
| 25337 | function createDateParser(regexp, mapping) { |
| 25338 | return function(iso, date) { |
nothing calls this directly
no test coverage detected