* Retrieves the previous date part in the list of parts.
()
| 1855 | * Retrieves the previous date part in the list of parts. |
| 1856 | */ |
| 1857 | previousPart(): Option.Option<DatePart> { |
| 1858 | const currentPartIndex = Arr.findFirstIndex(this.parts, (part) => part === this) |
| 1859 | if (Option.isSome(currentPartIndex)) { |
| 1860 | return Arr.findLast(this.parts.slice(0, currentPartIndex.value), (part) => !part.isToken()) |
| 1861 | } |
| 1862 | return Option.none() |
| 1863 | } |
| 1864 | |
| 1865 | toString() { |
| 1866 | return String(this.date) |