(isoWeek, existingDate)
| 19967 | } |
| 19968 | |
| 19969 | function weekParser(isoWeek, existingDate) { |
| 19970 | if (isDate(isoWeek)) { |
| 19971 | return isoWeek; |
| 19972 | } |
| 19973 | |
| 19974 | if (isString(isoWeek)) { |
| 19975 | WEEK_REGEXP.lastIndex = 0; |
| 19976 | var parts = WEEK_REGEXP.exec(isoWeek); |
| 19977 | if (parts) { |
| 19978 | var year = +parts[1], |
| 19979 | week = +parts[2], |
| 19980 | hours = 0, |
| 19981 | minutes = 0, |
| 19982 | seconds = 0, |
| 19983 | milliseconds = 0, |
| 19984 | firstThurs = getFirstThursdayOfYear(year), |
| 19985 | addDays = (week - 1) * 7; |
| 19986 | |
| 19987 | if (existingDate) { |
| 19988 | hours = existingDate.getHours(); |
| 19989 | minutes = existingDate.getMinutes(); |
| 19990 | seconds = existingDate.getSeconds(); |
| 19991 | milliseconds = existingDate.getMilliseconds(); |
| 19992 | } |
| 19993 | |
| 19994 | return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); |
| 19995 | } |
| 19996 | } |
| 19997 | |
| 19998 | return NaN; |
| 19999 | } |
| 20000 | |
| 20001 | function createDateParser(regexp, mapping) { |
| 20002 | return function(iso, date) { |
nothing calls this directly
no test coverage detected