* Retrieves the previous date part in the list of parts.
()
| 413 | * Retrieves the previous date part in the list of parts. |
| 414 | */ |
| 415 | previousPart(): Option.Option<DatePart> { |
| 416 | return Arr.findFirstIndex(this.parts, (part) => part === this).pipe( |
| 417 | Option.flatMap((currentPartIndex) => |
| 418 | Arr.findLast(this.parts.slice(0, currentPartIndex), (part) => !part.isToken()) |
| 419 | ) |
| 420 | ) |
| 421 | } |
| 422 | |
| 423 | toString() { |
| 424 | return String(this.date) |