(dateString: string, token: string, match: Match)
| 8 | priority = 90; |
| 9 | |
| 10 | parse(dateString: string, token: string, match: Match): ParseResult<number> { |
| 11 | switch (token) { |
| 12 | // Tue |
| 13 | case "E": |
| 14 | case "EE": |
| 15 | case "EEE": |
| 16 | return ( |
| 17 | match.day(dateString, { |
| 18 | width: "abbreviated", |
| 19 | context: "formatting", |
| 20 | }) || |
| 21 | match.day(dateString, { width: "short", context: "formatting" }) || |
| 22 | match.day(dateString, { width: "narrow", context: "formatting" }) |
| 23 | ); |
| 24 | // T |
| 25 | case "EEEEE": |
| 26 | return match.day(dateString, { |
| 27 | width: "narrow", |
| 28 | context: "formatting", |
| 29 | }); |
| 30 | // Tu |
| 31 | case "EEEEEE": |
| 32 | return ( |
| 33 | match.day(dateString, { width: "short", context: "formatting" }) || |
| 34 | match.day(dateString, { width: "narrow", context: "formatting" }) |
| 35 | ); |
| 36 | // Tuesday |
| 37 | case "EEEE": |
| 38 | default: |
| 39 | return ( |
| 40 | match.day(dateString, { width: "wide", context: "formatting" }) || |
| 41 | match.day(dateString, { |
| 42 | width: "abbreviated", |
| 43 | context: "formatting", |
| 44 | }) || |
| 45 | match.day(dateString, { width: "short", context: "formatting" }) || |
| 46 | match.day(dateString, { width: "narrow", context: "formatting" }) |
| 47 | ); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | override validate<DateType extends Date>( |
| 52 | _date: DateType, |
no outgoing calls
no test coverage detected