(dateStr: string)
| 32 | ]; |
| 33 | |
| 34 | export function convertIsoToHumanReadable(dateStr: string): string { |
| 35 | let date = new Date(dateStr); |
| 36 | |
| 37 | let day = date.getDate(); |
| 38 | let monthIndex = date.getMonth(); |
| 39 | let year = date.getFullYear(); |
| 40 | |
| 41 | let suffix = "th"; |
| 42 | if ([1, 21, 31].includes(day)) { |
| 43 | suffix = "st"; |
| 44 | } else if ([2, 22].includes(day)) { |
| 45 | suffix = "nd"; |
| 46 | } else if ([3, 23].includes(day)) { |
| 47 | suffix = "rd"; |
| 48 | } |
| 49 | |
| 50 | return `${day}${suffix} ${monthNames[monthIndex]} ${year}`; |
| 51 | } |
| 52 | |
| 53 | export function fillVariables( |
| 54 | requests: { |
no outgoing calls
no test coverage detected