@remit/web-client 0.0.250 → 0.0.251
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remit/web-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.251",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Remit web client, published as composable primitives — the app shell, auth shells, and runtime config. A distributor imports what it composes and bundles it.",
|
|
6
6
|
"exports": {
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
datesBetween,
|
|
17
17
|
type FreeStretch,
|
|
18
18
|
freeStretchesFromSpans,
|
|
19
|
+
mergeBusySpans,
|
|
19
20
|
} from "@remit/ui";
|
|
20
21
|
import { isoDate } from "@/lib/calendar-route";
|
|
21
22
|
import { addDays, type CalendarWindow, calendarWindow } from "./window";
|
|
@@ -178,24 +179,10 @@ export function busySpansByDate(
|
|
|
178
179
|
}
|
|
179
180
|
}
|
|
180
181
|
|
|
181
|
-
for (const [date, day] of byDate) byDate.set(date,
|
|
182
|
+
for (const [date, day] of byDate) byDate.set(date, mergeBusySpans(day));
|
|
182
183
|
return byDate;
|
|
183
184
|
}
|
|
184
185
|
|
|
185
|
-
function mergeSpans(spans: BusySpan[]): BusySpan[] {
|
|
186
|
-
const sorted = [...spans].sort((a, b) => a.from - b.from);
|
|
187
|
-
const merged: BusySpan[] = [];
|
|
188
|
-
for (const span of sorted) {
|
|
189
|
-
const last = merged[merged.length - 1];
|
|
190
|
-
if (last && span.from <= last.to) {
|
|
191
|
-
last.to = Math.max(last.to, span.to);
|
|
192
|
-
continue;
|
|
193
|
-
}
|
|
194
|
-
merged.push({ ...span });
|
|
195
|
-
}
|
|
196
|
-
return merged;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
186
|
/**
|
|
200
187
|
* The free time on every day the strip holds, out of the busy spans the server
|
|
201
188
|
* merged across every calendar. It is `freeStretchesFromSpans` and nothing
|