init at work

This commit is contained in:
Mathias Schneider
2026-03-27 12:58:01 +01:00
parent 352c352056
commit 8d40597732
60 changed files with 16498 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
# Understanding `alignedStarts`
`alignedStarts` is an array of date boundaries that match your backend schedule rule.
## Concept
```ts
const alignedStarts: Date[] = [];
```
Each item is a valid period boundary (for example Monday 00:00 in backend-local schedule terms).
Later, you form intervals by pairing adjacent items:
```ts
const start = alignedStarts[index];
const end = alignedStarts[index + 1];
```
So if `alignedStarts` has `N` items, you can make up to `N-1` intervals.
## Why this is useful
- Keeps schedule boundaries consistent.
- Makes interval generation deterministic.
- Handles DST-safe boundaries when generated correctly.