| 4 | const cache = new Map<string, CalendarDate>(); |
| 5 | |
| 6 | const getMinCalendarDate = (primaryCalendarType: `${CalendarType}`) => { |
| 7 | const key = `min ${primaryCalendarType}`; |
| 8 | |
| 9 | if (!cache.has(key)) { |
| 10 | const minDate = new CalendarDate(1, 0, 1, primaryCalendarType); |
| 11 | minDate.setYear(1); |
| 12 | minDate.setMonth(0); |
| 13 | minDate.setDate(1); |
| 14 | cache.set(key, minDate); |
| 15 | } |
| 16 | |
| 17 | return cache.get(key)!; |
| 18 | }; |
| 19 | |
| 20 | const getMaxCalendarDate = (primaryCalendarType: `${CalendarType}`) => { |
| 21 | const key = `max ${primaryCalendarType}`; |