(isoWeek, existingDate)
| 19631 | } |
| 19632 | |
| 19633 | function weekParser(isoWeek, existingDate) { |
| 19634 | if (isDate(isoWeek)) { |
| 19635 | return isoWeek; |
| 19636 | } |
| 19637 | |
| 19638 | if (isString(isoWeek)) { |
| 19639 | WEEK_REGEXP.lastIndex = 0; |
| 19640 | var parts = WEEK_REGEXP.exec(isoWeek); |
| 19641 | if (parts) { |
| 19642 | var year = +parts[1], |
| 19643 | week = +parts[2], |
| 19644 | hours = 0, |
| 19645 | minutes = 0, |
| 19646 | seconds = 0, |
| 19647 | milliseconds = 0, |
| 19648 | firstThurs = getFirstThursdayOfYear(year), |
| 19649 | addDays = (week - 1) * 7; |
| 19650 | |
| 19651 | if (existingDate) { |
| 19652 | hours = existingDate.getHours(); |
| 19653 | minutes = existingDate.getMinutes(); |
| 19654 | seconds = existingDate.getSeconds(); |
| 19655 | milliseconds = existingDate.getMilliseconds(); |
| 19656 | } |
| 19657 | |
| 19658 | return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); |
| 19659 | } |
| 19660 | } |
| 19661 | |
| 19662 | return NaN; |
| 19663 | } |
| 19664 | |
| 19665 | function createDateParser(regexp, mapping) { |
| 19666 | return function(iso, date) { |
nothing calls this directly
no test coverage detected