(isoWeek, existingDate)
| 26585 | } |
| 26586 | |
| 26587 | function weekParser(isoWeek, existingDate) { |
| 26588 | if (isDate(isoWeek)) { |
| 26589 | return isoWeek; |
| 26590 | } |
| 26591 | |
| 26592 | if (isString(isoWeek)) { |
| 26593 | WEEK_REGEXP.lastIndex = 0; |
| 26594 | var parts = WEEK_REGEXP.exec(isoWeek); |
| 26595 | if (parts) { |
| 26596 | var year = +parts[1], |
| 26597 | week = +parts[2], |
| 26598 | hours = 0, |
| 26599 | minutes = 0, |
| 26600 | seconds = 0, |
| 26601 | milliseconds = 0, |
| 26602 | firstThurs = getFirstThursdayOfYear(year), |
| 26603 | addDays = (week - 1) * 7; |
| 26604 | |
| 26605 | if (existingDate) { |
| 26606 | hours = existingDate.getHours(); |
| 26607 | minutes = existingDate.getMinutes(); |
| 26608 | seconds = existingDate.getSeconds(); |
| 26609 | milliseconds = existingDate.getMilliseconds(); |
| 26610 | } |
| 26611 | |
| 26612 | return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); |
| 26613 | } |
| 26614 | } |
| 26615 | |
| 26616 | return NaN; |
| 26617 | } |
| 26618 | |
| 26619 | function createDateParser(regexp, mapping) { |
| 26620 | return function(iso, previousDate) { |
nothing calls this directly
no test coverage detected