()
| 541 | } |
| 542 | |
| 543 | toString() { |
| 544 | const date = this.date.getDate() |
| 545 | const day = this.date.getDay() |
| 546 | return Match.value(this.token).pipe( |
| 547 | Match.when("DD", () => `${date}`.padStart(2, "0")), |
| 548 | Match.when("Do", () => `${date}${this.ordinalIndicator(date)}`), |
| 549 | Match.when("d", () => `${day + 1}`), |
| 550 | Match.when("ddd", () => this.locales!.weekdaysShort[day]!), |
| 551 | Match.when("dddd", () => this.locales!.weekdays[day]!), |
| 552 | Match.orElse(() => `${date}`) |
| 553 | ) |
| 554 | } |
| 555 | |
| 556 | private ordinalIndicator(day: number): string { |
| 557 | return Match.value(day % 10).pipe( |
nothing calls this directly
no test coverage detected