|
1 | 1 | # What API methods do we need? |
2 | 2 |
|
3 | | -[x] startOf(ZonedDateTime, unit): ZonedDateTime ✅ |
4 | | -[x] endOf(ZonedDateTime, unit): ZonedDateTime ✅ |
5 | | -[x] add(ZonedDateTime, duration): ZonedDateTime ✅ |
6 | | -[x] subtract(ZonedDateTime, duration): ZonedDateTime ✅ |
7 | | -[x] until(ZonedDateTime, ZonedDateTime): Duration ✅ |
8 | | -[x] since(ZonedDateTime, ZonedDateTime): Duration ✅ |
9 | | -[x] equals(ZonedDateTime, ZonedDateTime, unit): boolean ✅ |
10 | | -[x] isBefore(ZonedDateTime, ZonedDateTime): boolean ✅ |
11 | | -[x] isAfter(ZonedDateTime, ZonedDateTime): boolean ✅ |
12 | | -[x] round(unit): ZonedDateTime ✅ |
13 | | -[x] isSameOrBefore(ZonedDateTime, ZonedDateTime, unit): boolean ✅ |
14 | | -[x] isSameOrAfter(ZonedDateTime, ZonedDateTime, unit): boolean ✅ |
15 | | -[x] isBetween(ZonedDateTime, Range): boolean ✅ |
16 | | -[x] intersects(ZonedDateTime, Range): boolean ✅ |
17 | | -[ ] time(PlainTime): ZonedDateTime (use getter/setter?) |
18 | | -[x] timeZone(IANATimeZoneId): ZonedDateTime (use getter/setter?) ✅ |
19 | | -[x] calendar(Calendar): ZonedDateTime (use getter/setter?) ✅ |
20 | | -[x] asEpoch ✅ |
21 | | -[x] asString ✅ |
22 | | -[x] asZonedDateTime ✅ |
| 3 | +## Date Operations |
| 4 | + |
| 5 | +- [x] `startOf(input: DateInput, options: StartOfOptions): DateOperationResult` ✅ |
| 6 | +- [x] `endOf(input: DateInput, options: EndOfOptions): DateOperationResult` ✅ |
| 7 | +- [x] `add(input: DateInput, options: AddOptions): DateOperationResult` ✅ |
| 8 | +- [x] `subtract(input: DateInput, options: SubtractOptions): DateOperationResult` ✅ |
| 9 | +- [x] `round(input: DateInput, options: RoundOptions): DateOperationResult` ✅ |
| 10 | + |
| 11 | +## Duration Calculations |
| 12 | + |
| 13 | +- [x] `until(start: DateInput, end: DateInput, options: UntilOptions): number` ✅ |
| 14 | +- [x] `since(start: DateInput, end: DateInput, options: SinceOptions): number` ✅ |
| 15 | + |
| 16 | +## Comparisons |
| 17 | + |
| 18 | +- [x] `equals(date1: DateInput, date2: DateInput, options: EqualsOptions): boolean` ✅ |
| 19 | +- [x] `isBefore(date1: DateInput, date2: DateInput, options?: IsBeforeOptions): boolean` ✅ |
| 20 | +- [x] `isAfter(date1: DateInput, date2: DateInput, options?: IsAfterOptions): boolean` ✅ |
| 21 | +- [x] `isSameOrBefore(date1: DateInput, date2: DateInput, options: IsSameOrBeforeOptions): boolean` ✅ |
| 22 | +- [x] `isSameOrAfter(date1: DateInput, date2: DateInput, options: IsSameOrAfterOptions): boolean` ✅ |
| 23 | + |
| 24 | +## Range Operations |
| 25 | + |
| 26 | +- [x] `isBetween(date: DateInput, options: IsBetweenOptions): boolean` ✅ |
| 27 | +- [x] `intersects(date: DateInput, options: IntersectsOptions): boolean` ✅ |
| 28 | + |
| 29 | +## Type Definitions |
| 30 | + |
| 31 | +- `DateInput = string | number | Date | Temporal.ZonedDateTime` |
| 32 | +- `DateOperationResult` - Object with `value`, `asDate()`, `asEpoch()`, `asString()`, `asZonedDateTime()`, etc. |
| 33 | +- `Range = { start: DateInput, end: DateInput }` |
| 34 | + |
| 35 | +## Future Considerations |
| 36 | + |
| 37 | +- [ ] `time(PlainTime): ZonedDateTime` (use getter/setter?) |
| 38 | +- [x] `timeZone(IANATimeZoneId): ZonedDateTime` (use getter/setter?) ✅ |
| 39 | +- [x] `calendar(Calendar): ZonedDateTime` (use getter/setter?) ✅ |
0 commit comments