(isoWeek, existingDate)
| 24541 | } |
| 24542 | |
| 24543 | function weekParser(isoWeek, existingDate) { |
| 24544 | if (isDate(isoWeek)) { |
| 24545 | return isoWeek; |
| 24546 | } |
| 24547 | |
| 24548 | if (isString(isoWeek)) { |
| 24549 | WEEK_REGEXP.lastIndex = 0; |
| 24550 | var parts = WEEK_REGEXP.exec(isoWeek); |
| 24551 | if (parts) { |
| 24552 | var year = +parts[1], |
| 24553 | week = +parts[2], |
| 24554 | hours = 0, |
| 24555 | minutes = 0, |
| 24556 | seconds = 0, |
| 24557 | milliseconds = 0, |
| 24558 | firstThurs = getFirstThursdayOfYear(year), |
| 24559 | addDays = (week - 1) * 7; |
| 24560 | |
| 24561 | if (existingDate) { |
| 24562 | hours = existingDate.getHours(); |
| 24563 | minutes = existingDate.getMinutes(); |
| 24564 | seconds = existingDate.getSeconds(); |
| 24565 | milliseconds = existingDate.getMilliseconds(); |
| 24566 | } |
| 24567 | |
| 24568 | return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); |
| 24569 | } |
| 24570 | } |
| 24571 | |
| 24572 | return NaN; |
| 24573 | } |
| 24574 | |
| 24575 | function createDateParser(regexp, mapping) { |
| 24576 | return function(iso, date) { |
nothing calls this directly
no test coverage detected