@remit/ui 0.0.193 → 0.0.195
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 +1 -1
- package/src/components/account-service-change-dialog.stories.tsx +1 -1
- package/src/components/account-service-choice.stories.tsx +1 -1
- package/src/components/account-service-status.stories.tsx +1 -1
- package/src/components/account-service-toggles.stories.tsx +2 -1
- package/src/components/address-display.stories.tsx +1 -1
- package/src/components/address-tag.stories.tsx +1 -1
- package/src/components/agenda-composer.render.test.ts +1 -0
- package/src/components/agenda-composer.stories.tsx +3 -1
- package/src/components/agenda-flow.stories.tsx +1 -1
- package/src/components/agenda-flow.tsx +3 -0
- package/src/components/agenda-panels.stories.tsx +1 -1
- package/src/components/app-password-hint.stories.tsx +1 -1
- package/src/components/app-top-bar.stories.tsx +1 -1
- package/src/components/attachment-list.stories.tsx +1 -1
- package/src/components/attendee-row.stories.tsx +1 -1
- package/src/components/auth-card.stories.tsx +1 -1
- package/src/components/auth-footer.stories.tsx +1 -1
- package/src/components/auth-hero.stories.tsx +1 -1
- package/src/components/auto-moved-badge.stories.tsx +1 -1
- package/src/components/banner.stories.tsx +1 -1
- package/src/components/bottom-sheet.stories.tsx +1 -1
- package/src/components/brief-empty.stories.tsx +1 -1
- package/src/components/brief-section.stories.tsx +1 -1
- package/src/components/brief-sections.stories.tsx +1 -1
- package/src/components/calendar-clash-strip.stories.tsx +1 -1
- package/src/components/calendar-event-chip.stories.tsx +1 -1
- package/src/components/calendar-grid.stories.tsx +1 -1
- package/src/components/calendar-invite-card.stories.tsx +1 -1
- package/src/components/calendar-list.stories.tsx +1 -1
- package/src/components/calendar-parse-badge.stories.tsx +1 -1
- package/src/components/calendar-slot-offers.render.test.ts +7 -1
- package/src/components/calendar-slot-offers.stories.tsx +8 -2
- package/src/components/calendar-suggestion-deck.stories.tsx +1 -1
- package/src/components/calendar-toolbar.stories.tsx +1 -1
- package/src/components/calendar-types.ts +2 -0
- package/src/components/category-badge.stories.tsx +1 -1
- package/src/components/category-presentation.stories.tsx +1 -1
- package/src/components/checkbox.stories.tsx +1 -1
- package/src/components/compose-action-bar.stories.tsx +1 -1
- package/src/components/compose-address-field.stories.tsx +1 -1
- package/src/components/compose-body.stories.tsx +1 -1
- package/src/components/compose-header.stories.tsx +1 -1
- package/src/components/compose-language-chip.stories.tsx +1 -1
- package/src/components/compose-language-setting.stories.tsx +1 -1
- package/src/components/compose-mode-toggle.stories.tsx +1 -1
- package/src/components/compose-smtp-missing-banner.stories.tsx +1 -1
- package/src/components/confirm-dialog.stories.tsx +1 -1
- package/src/components/custom-recurrence.stories.tsx +1 -1
- package/src/components/dialog.stories.tsx +1 -1
- package/src/components/event-detail.stories.tsx +1 -1
- package/src/components/event-editor.render.test.ts +23 -0
- package/src/components/event-editor.stories.tsx +32 -5
- package/src/components/event-editor.tsx +78 -50
- package/src/components/event-quick-entry.stories.tsx +1 -1
- package/src/components/event-suggestion-card.stories.tsx +1 -1
- package/src/components/filter-rule-editor.stories.tsx +1 -1
- package/src/components/filter-sheet.stories.tsx +1 -1
- package/src/components/folder-manage-actions.stories.tsx +1 -1
- package/src/components/folder-manager.stories.tsx +1 -1
- package/src/components/folder-rename-dialog.stories.tsx +1 -1
- package/src/components/folder-row.stories.tsx +1 -1
- package/src/components/folder-tree-picker.stories.tsx +1 -1
- package/src/components/intelligence-calendar-fixtures.ts +7 -1
- package/src/components/intelligence-panel-calendar.stories.tsx +2 -1
- package/src/components/intelligence-panel.stories.tsx +1 -1
- package/src/components/isolated-email-frame.stories.tsx +1 -1
- package/src/components/label-chip.stories.tsx +1 -1
- package/src/components/list-result-header.stories.tsx +1 -1
- package/src/components/mail-action-toolbar.stories.tsx +1 -1
- package/src/components/mail-header.stories.tsx +2 -1
- package/src/components/message-body-view.stories.tsx +1 -1
- package/src/components/message-list-pane.stories.tsx +1 -1
- package/src/components/message-list-state.stories.tsx +1 -1
- package/src/components/message-row.stories.tsx +1 -1
- package/src/components/message-settlement.stories.tsx +1 -1
- package/src/components/mobile-message-action-bar.stories.tsx +1 -1
- package/src/components/mobile-search-view.stories.tsx +1 -1
- package/src/components/nav-sidebar.stories.tsx +1 -1
- package/src/components/new-folder-action.stories.tsx +1 -1
- package/src/components/new-folder-form.stories.tsx +1 -1
- package/src/components/outbox-row.stories.tsx +1 -1
- package/src/components/plain-text-editor.stories.tsx +1 -1
- package/src/components/popover-menu.stories.tsx +1 -1
- package/src/components/primitives.stories.tsx +1 -1
- package/src/components/progress-bar.stories.tsx +1 -1
- package/src/components/pull-to-refresh.stories.tsx +1 -1
- package/src/components/quarantine-section.stories.tsx +1 -1
- package/src/components/quoted-text.stories.tsx +1 -1
- package/src/components/reading-pane.stories.tsx +1 -1
- package/src/components/recurrence-scope-prompt.stories.tsx +1 -1
- package/src/components/refresh-button.stories.tsx +1 -1
- package/src/components/rescue-banner.stories.tsx +1 -1
- package/src/components/rescue-candidate-row.stories.tsx +1 -1
- package/src/components/rescue-from-spam-flow.stories.tsx +1 -1
- package/src/components/rich-text-editor.stories.tsx +1 -1
- package/src/components/role-appointment-list.stories.tsx +1 -1
- package/src/components/role-appointment-prompt.stories.tsx +1 -1
- package/src/components/row-actions.stories.tsx +1 -1
- package/src/components/search-bar.stories.tsx +1 -1
- package/src/components/search-chip-input.stories.tsx +1 -1
- package/src/components/search-conversion-notice.stories.tsx +1 -1
- package/src/components/search-results.stories.tsx +1 -1
- package/src/components/search-token-chip.stories.tsx +1 -1
- package/src/components/selection-top-bar.stories.tsx +1 -1
- package/src/components/self-update-progress-overlay.stories.tsx +1 -1
- package/src/components/self-update.stories.tsx +1 -1
- package/src/components/sender-trust-indicator.stories.tsx +1 -1
- package/src/components/settings-primitives.stories.tsx +1 -1
- package/src/components/shell-top-bar.stories.tsx +1 -1
- package/src/components/slide-panel.stories.tsx +1 -1
- package/src/components/spam-results-offer.stories.tsx +1 -1
- package/src/components/swipeable-row.stories.tsx +1 -1
- package/src/components/touch-list-body.stories.tsx +1 -1
- package/src/components/wizard.stories.tsx +1 -1
- package/src/index.ts +4 -0
- package/src/lib/agenda-time.ts +15 -0
- package/src/lib/calendar-slot-pick.test.ts +25 -5
- package/src/lib/calendar-slot-pick.ts +13 -3
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
|
2
2
|
import { RescueBanner } from "./rescue-banner.js";
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof RescueBanner> = {
|
|
5
|
-
title: "
|
|
5
|
+
title: "Design System/Spam rescue/RescueBanner",
|
|
6
6
|
component: RescueBanner,
|
|
7
7
|
parameters: { layout: "padded" },
|
|
8
8
|
args: { onReview: () => {} },
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./rescue-candidate-row.js";
|
|
7
7
|
|
|
8
8
|
const meta: Meta<typeof RescueCandidateRow> = {
|
|
9
|
-
title: "
|
|
9
|
+
title: "Design System/Spam rescue/RescueCandidateRow",
|
|
10
10
|
component: RescueCandidateRow,
|
|
11
11
|
parameters: { layout: "padded" },
|
|
12
12
|
decorators: [
|
|
@@ -6,7 +6,7 @@ import type { RescueCandidate } from "./rescue-candidate-row.js";
|
|
|
6
6
|
import { RescueFromSpamFlow } from "./rescue-from-spam-flow.js";
|
|
7
7
|
|
|
8
8
|
const meta: Meta<typeof RescueFromSpamFlow> = {
|
|
9
|
-
title: "
|
|
9
|
+
title: "Playground/Shipped/Mail/Spam rescue/RescueFromSpamFlow",
|
|
10
10
|
component: RescueFromSpamFlow,
|
|
11
11
|
parameters: { layout: "fullscreen" },
|
|
12
12
|
decorators: [
|
|
@@ -23,7 +23,7 @@ import { openSpellcheckWorker } from "./rich-text-spellcheck-worker-provider.js"
|
|
|
23
23
|
* gives it rather than only the space its own text needs.
|
|
24
24
|
*/
|
|
25
25
|
const meta: Meta<typeof RichTextEditor> = {
|
|
26
|
-
title: "
|
|
26
|
+
title: "Design System/Compose/RichTextEditor",
|
|
27
27
|
component: RichTextEditor,
|
|
28
28
|
parameters: { layout: "centered" },
|
|
29
29
|
decorators: [
|
|
@@ -79,7 +79,7 @@ function Harness({ initialSelectedId, phaseCycle, ...props }: HarnessProps) {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
const meta: Meta<typeof Harness> = {
|
|
82
|
-
title: "Mail/RoleAppointmentPrompt",
|
|
82
|
+
title: "Design System/Mail/RoleAppointmentPrompt",
|
|
83
83
|
component: Harness,
|
|
84
84
|
};
|
|
85
85
|
export default meta;
|
|
@@ -3,7 +3,7 @@ import { RotateCcw, Send, Trash2 } from "lucide-react";
|
|
|
3
3
|
import { RowActions } from "./row-actions.js";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof RowActions> = {
|
|
6
|
-
title: "Primitives/RowActions",
|
|
6
|
+
title: "Design System/Primitives/RowActions",
|
|
7
7
|
component: RowActions,
|
|
8
8
|
parameters: { layout: "padded" },
|
|
9
9
|
};
|
|
@@ -3,7 +3,7 @@ import { useState } from "react";
|
|
|
3
3
|
import { type SearchChip, SearchChipInput } from "./search-chip-input.js";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof SearchChipInput> = {
|
|
6
|
-
title: "
|
|
6
|
+
title: "Design System/Search/SearchChipInput",
|
|
7
7
|
component: SearchChipInput,
|
|
8
8
|
parameters: { layout: "padded" },
|
|
9
9
|
};
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
|
2
2
|
import { SearchConversionNoticeView } from "./search-conversion-notice.js";
|
|
3
3
|
|
|
4
4
|
const meta = {
|
|
5
|
-
title: "Filters/Search conversion notice",
|
|
5
|
+
title: "Design System/Filters/Search conversion notice",
|
|
6
6
|
component: SearchConversionNoticeView,
|
|
7
7
|
parameters: { layout: "centered" },
|
|
8
8
|
} satisfies Meta<typeof SearchConversionNoticeView>;
|
|
@@ -161,7 +161,7 @@ function Harness(props: Parameters<typeof SearchResults>[0]) {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
const meta: Meta<typeof SearchResults> = {
|
|
164
|
-
title: "
|
|
164
|
+
title: "Playground/Shipped/Mail/Search/SearchResults",
|
|
165
165
|
component: SearchResults,
|
|
166
166
|
parameters: { layout: "centered" },
|
|
167
167
|
decorators: [listPaneFrame],
|
|
@@ -3,7 +3,7 @@ import { useState } from "react";
|
|
|
3
3
|
import { SearchTokenChips } from "./search-token-chip.js";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof SearchTokenChips> = {
|
|
6
|
-
title: "
|
|
6
|
+
title: "Design System/Search/SearchTokenChips",
|
|
7
7
|
component: SearchTokenChips,
|
|
8
8
|
parameters: { layout: "padded" },
|
|
9
9
|
};
|
|
@@ -6,7 +6,7 @@ import { SearchBar } from "./search-bar.js";
|
|
|
6
6
|
import { SelectionTopBar } from "./selection-top-bar.js";
|
|
7
7
|
|
|
8
8
|
const meta: Meta<typeof SelectionTopBar> = {
|
|
9
|
-
title: "
|
|
9
|
+
title: "Playground/Shipped/Mail/SelectionTopBar",
|
|
10
10
|
component: SelectionTopBar,
|
|
11
11
|
parameters: { layout: "padded" },
|
|
12
12
|
args: {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./self-update-progress-overlay.js";
|
|
7
7
|
|
|
8
8
|
const meta: Meta<typeof SelfUpdateProgressOverlay> = {
|
|
9
|
-
title: "Settings/Self-update restart",
|
|
9
|
+
title: "Design System/Settings/Self-update restart",
|
|
10
10
|
component: SelfUpdateProgressOverlay,
|
|
11
11
|
parameters: { layout: "fullscreen" },
|
|
12
12
|
args: { target: demoRelease.version },
|
|
@@ -13,7 +13,7 @@ const NOW = Date.parse("2026-07-20T12:00:00.000Z");
|
|
|
13
13
|
const CURRENT = "0.9.3";
|
|
14
14
|
|
|
15
15
|
const meta: Meta<typeof SelfUpdateSection> = {
|
|
16
|
-
title: "Settings/Self-update",
|
|
16
|
+
title: "Design System/Settings/Self-update",
|
|
17
17
|
component: SelfUpdateSection,
|
|
18
18
|
parameters: { layout: "padded" },
|
|
19
19
|
args: {
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
2
2
|
import { SenderTrustIndicator } from "./sender-trust-indicator.js";
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof SenderTrustIndicator> = {
|
|
5
|
-
title: "Mail/SenderTrustIndicator",
|
|
5
|
+
title: "Design System/Mail/SenderTrustIndicator",
|
|
6
6
|
component: SenderTrustIndicator,
|
|
7
7
|
parameters: { layout: "centered" },
|
|
8
8
|
};
|
|
@@ -6,7 +6,7 @@ import type { SearchChip } from "./search-chip-input.js";
|
|
|
6
6
|
import { type ShellSearchScope, ShellTopBar } from "./shell-top-bar.js";
|
|
7
7
|
|
|
8
8
|
const meta: Meta<typeof ShellTopBar> = {
|
|
9
|
-
title: "Mail/ShellTopBar",
|
|
9
|
+
title: "Design System/Mail/ShellTopBar",
|
|
10
10
|
component: ShellTopBar,
|
|
11
11
|
parameters: { layout: "fullscreen" },
|
|
12
12
|
};
|
|
@@ -6,7 +6,7 @@ import { Input } from "./input.js";
|
|
|
6
6
|
import { SlidePanel } from "./slide-panel.js";
|
|
7
7
|
|
|
8
8
|
const meta: Meta<typeof SlidePanel> = {
|
|
9
|
-
title: "
|
|
9
|
+
title: "Design System/Primitives/SlidePanel",
|
|
10
10
|
component: SlidePanel,
|
|
11
11
|
parameters: { layout: "fullscreen" },
|
|
12
12
|
};
|
|
@@ -12,7 +12,7 @@ const listPaneFrame: Decorator = (Story) => (
|
|
|
12
12
|
);
|
|
13
13
|
|
|
14
14
|
const meta: Meta<typeof SpamResultsOffer> = {
|
|
15
|
-
title: "
|
|
15
|
+
title: "Design System/Spam rescue/SpamResultsOffer",
|
|
16
16
|
component: SpamResultsOffer,
|
|
17
17
|
parameters: { layout: "centered" },
|
|
18
18
|
decorators: [listPaneFrame],
|
|
@@ -35,7 +35,7 @@ function PhoneFrame({ children }: { children: React.ReactNode }) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
const meta: Meta<typeof SwipeableRow> = {
|
|
38
|
-
title: "Primitives/SwipeableRow",
|
|
38
|
+
title: "Design System/Primitives/SwipeableRow",
|
|
39
39
|
component: SwipeableRow,
|
|
40
40
|
parameters: { layout: "padded" },
|
|
41
41
|
args: baseArgs,
|
|
@@ -6,7 +6,7 @@ import type { ServerSecurity } from "./security-select.js";
|
|
|
6
6
|
import { ConnectorTile, ServerFields, WizardShell } from "./wizard.js";
|
|
7
7
|
|
|
8
8
|
const meta: Meta = {
|
|
9
|
-
title: "
|
|
9
|
+
title: "Design System/Primitives/Wizard",
|
|
10
10
|
};
|
|
11
11
|
export default meta;
|
|
12
12
|
|
package/src/index.ts
CHANGED
|
@@ -347,6 +347,8 @@ export {
|
|
|
347
347
|
EventTitleField,
|
|
348
348
|
EventWhenField,
|
|
349
349
|
endsBeforeStart,
|
|
350
|
+
withAllDay,
|
|
351
|
+
withStartDate,
|
|
350
352
|
} from "./components/event-editor.js";
|
|
351
353
|
export {
|
|
352
354
|
EventEditorPane,
|
|
@@ -941,6 +943,7 @@ export {
|
|
|
941
943
|
DAY_END_MINUTE,
|
|
942
944
|
DAY_START_MINUTE,
|
|
943
945
|
datesBetween,
|
|
946
|
+
daysFrom,
|
|
944
947
|
FREE_MINUTES,
|
|
945
948
|
type FreeStretch,
|
|
946
949
|
formatMinute,
|
|
@@ -953,6 +956,7 @@ export {
|
|
|
953
956
|
groupOverlapping,
|
|
954
957
|
isClearDay,
|
|
955
958
|
isEmptyDay,
|
|
959
|
+
lastDayOf,
|
|
956
960
|
mergeBusySpans,
|
|
957
961
|
minuteOfDay,
|
|
958
962
|
monthLabel,
|
package/src/lib/agenda-time.ts
CHANGED
|
@@ -46,6 +46,21 @@ export function addDays(date: string, days: number): string {
|
|
|
46
46
|
return cursor.toISOString().slice(0, 10);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
export function daysFrom(from: string, to: string): number {
|
|
50
|
+
return Math.round(
|
|
51
|
+
(Date.parse(`${to}T00:00:00Z`) - Date.parse(`${from}T00:00:00Z`)) /
|
|
52
|
+
86_400_000,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function lastDayOf(event: CalendarEventData): string {
|
|
57
|
+
const start = event.start.slice(0, 10);
|
|
58
|
+
const end = event.end.slice(0, 10);
|
|
59
|
+
if (!event.allDay) return end;
|
|
60
|
+
const last = addDays(end, -1);
|
|
61
|
+
return last < start ? start : last;
|
|
62
|
+
}
|
|
63
|
+
|
|
49
64
|
export function datesBetween(from: string, to: string): string[] {
|
|
50
65
|
const dates: string[] = [];
|
|
51
66
|
for (let cursor = from; cursor <= to; cursor = addDays(cursor, 1))
|
|
@@ -10,6 +10,7 @@ describe("pointPick", () => {
|
|
|
10
10
|
it("drafts an hour from the point that was clicked", () => {
|
|
11
11
|
assert.deepEqual(pointPick("2026-06-10T14:30:00+02:00", false), {
|
|
12
12
|
date: "2026-06-10",
|
|
13
|
+
endDate: "2026-06-10",
|
|
13
14
|
startTime: "14:30",
|
|
14
15
|
endTime: "15:30",
|
|
15
16
|
allDay: false,
|
|
@@ -30,6 +31,7 @@ describe("pointPick", () => {
|
|
|
30
31
|
it("carries an all-day point with no clock at all", () => {
|
|
31
32
|
assert.deepEqual(pointPick("2026-06-10", true), {
|
|
32
33
|
date: "2026-06-10",
|
|
34
|
+
endDate: "2026-06-10",
|
|
33
35
|
startTime: "",
|
|
34
36
|
endTime: "",
|
|
35
37
|
allDay: true,
|
|
@@ -37,10 +39,9 @@ describe("pointPick", () => {
|
|
|
37
39
|
});
|
|
38
40
|
|
|
39
41
|
it("rolls a draft that runs past midnight round the clock", () => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
);
|
|
42
|
+
const pick = pointPick("2026-06-10T23:30:00+02:00", false);
|
|
43
|
+
assert.equal(pick.endTime, "00:30");
|
|
44
|
+
assert.equal(pick.endDate, "2026-06-11");
|
|
44
45
|
});
|
|
45
46
|
});
|
|
46
47
|
|
|
@@ -54,6 +55,7 @@ describe("rangePick", () => {
|
|
|
54
55
|
),
|
|
55
56
|
{
|
|
56
57
|
date: "2026-06-10",
|
|
58
|
+
endDate: "2026-06-10",
|
|
57
59
|
startTime: "09:00",
|
|
58
60
|
endTime: "11:30",
|
|
59
61
|
allDay: false,
|
|
@@ -61,9 +63,27 @@ describe("rangePick", () => {
|
|
|
61
63
|
);
|
|
62
64
|
});
|
|
63
65
|
|
|
64
|
-
it("
|
|
66
|
+
it("keeps a dragged range that runs past midnight on its own end day", () => {
|
|
67
|
+
assert.deepEqual(
|
|
68
|
+
rangePick(
|
|
69
|
+
"2026-06-10T22:00:00+02:00",
|
|
70
|
+
"2026-06-11T01:00:00+02:00",
|
|
71
|
+
false,
|
|
72
|
+
),
|
|
73
|
+
{
|
|
74
|
+
date: "2026-06-10",
|
|
75
|
+
endDate: "2026-06-11",
|
|
76
|
+
startTime: "22:00",
|
|
77
|
+
endTime: "01:00",
|
|
78
|
+
allDay: false,
|
|
79
|
+
},
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("drops the clock off an all-day range and keeps its last day", () => {
|
|
65
84
|
assert.deepEqual(rangePick("2026-06-10", "2026-06-13", true), {
|
|
66
85
|
date: "2026-06-10",
|
|
86
|
+
endDate: "2026-06-12",
|
|
67
87
|
startTime: "",
|
|
68
88
|
endTime: "",
|
|
69
89
|
allDay: true,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CalendarSlotPick } from "../components/calendar-types.js";
|
|
2
|
+
import { addDays } from "./agenda-time.js";
|
|
2
3
|
import { addMinutesToClock } from "./event-phrase.js";
|
|
3
4
|
|
|
4
5
|
/** How long a new event is when nobody said — the hour every other path starts from. */
|
|
@@ -18,9 +19,14 @@ export function rangePick(
|
|
|
18
19
|
endStr: string,
|
|
19
20
|
allDay: boolean,
|
|
20
21
|
): CalendarSlotPick {
|
|
21
|
-
if (allDay)
|
|
22
|
+
if (allDay) {
|
|
23
|
+
const date = startStr.slice(0, 10);
|
|
24
|
+
const last = addDays(endStr.slice(0, 10), -1);
|
|
25
|
+
return { ...allDayPick(startStr), endDate: last < date ? date : last };
|
|
26
|
+
}
|
|
22
27
|
return {
|
|
23
28
|
date: startStr.slice(0, 10),
|
|
29
|
+
endDate: endStr.slice(0, 10),
|
|
24
30
|
startTime: startStr.slice(11, 16),
|
|
25
31
|
endTime: endStr.slice(11, 16),
|
|
26
32
|
allDay: false,
|
|
@@ -31,10 +37,13 @@ export function rangePick(
|
|
|
31
37
|
export function pointPick(dateStr: string, allDay: boolean): CalendarSlotPick {
|
|
32
38
|
if (allDay) return allDayPick(dateStr);
|
|
33
39
|
const startTime = dateStr.slice(11, 16);
|
|
40
|
+
const endTime = addMinutesToClock(startTime, DRAFT_MINUTES);
|
|
41
|
+
const date = dateStr.slice(0, 10);
|
|
34
42
|
return {
|
|
35
|
-
date
|
|
43
|
+
date,
|
|
44
|
+
endDate: endTime < startTime ? addDays(date, 1) : date,
|
|
36
45
|
startTime,
|
|
37
|
-
endTime
|
|
46
|
+
endTime,
|
|
38
47
|
allDay: false,
|
|
39
48
|
};
|
|
40
49
|
}
|
|
@@ -42,6 +51,7 @@ export function pointPick(dateStr: string, allDay: boolean): CalendarSlotPick {
|
|
|
42
51
|
function allDayPick(dateStr: string): CalendarSlotPick {
|
|
43
52
|
return {
|
|
44
53
|
date: dateStr.slice(0, 10),
|
|
54
|
+
endDate: dateStr.slice(0, 10),
|
|
45
55
|
startTime: "",
|
|
46
56
|
endTime: "",
|
|
47
57
|
allDay: true,
|