|
|
|
@ -67,7 +67,8 @@ export function ScheduleInPersonMeetingDialog({ |
|
|
|
if (inviteePubkeys.length === 0 || inviteePubkeys.length > MAX_CALENDAR_INVITEES) return false |
|
|
|
if (inviteePubkeys.length === 0 || inviteePubkeys.length > MAX_CALENDAR_INVITEES) return false |
|
|
|
if (eventType === 'date') { |
|
|
|
if (eventType === 'date') { |
|
|
|
if (!startDateStr.trim()) return false |
|
|
|
if (!startDateStr.trim()) return false |
|
|
|
if (endDateStr.trim() && endDateStr <= startDateStr) return false |
|
|
|
// Same as calendar-event getCalendarOccurrenceWindowMs: end === start is one day; invalid is end strictly before start.
|
|
|
|
|
|
|
|
if (endDateStr.trim() && endDateStr < startDateStr) return false |
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
if (!startDatetime.trim()) return false |
|
|
|
if (!startDatetime.trim()) return false |
|
|
|
@ -84,7 +85,7 @@ export function ScheduleInPersonMeetingDialog({ |
|
|
|
const d = 'preview' |
|
|
|
const d = 'preview' |
|
|
|
if (eventType === 'date') { |
|
|
|
if (eventType === 'date') { |
|
|
|
if (!startDateStr.trim()) return null |
|
|
|
if (!startDateStr.trim()) return null |
|
|
|
if (endDateStr.trim() && endDateStr <= startDateStr) return null |
|
|
|
if (endDateStr.trim() && endDateStr < startDateStr) return null |
|
|
|
return createInPersonDateBasedCalendarEventDraftEvent({ |
|
|
|
return createInPersonDateBasedCalendarEventDraftEvent({ |
|
|
|
d, |
|
|
|
d, |
|
|
|
title: title.trim() || t('In-person meeting'), |
|
|
|
title: title.trim() || t('In-person meeting'), |
|
|
|
@ -147,7 +148,7 @@ export function ScheduleInPersonMeetingDialog({ |
|
|
|
toast.error(t('Please set a start date')) |
|
|
|
toast.error(t('Please set a start date')) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if (endDateStr.trim() && endDateStr <= startDateStr) { |
|
|
|
if (endDateStr.trim() && endDateStr < startDateStr) { |
|
|
|
toast.error(t('End date must be after start date')) |
|
|
|
toast.error(t('End date must be after start date')) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
@ -322,6 +323,17 @@ export function ScheduleInPersonMeetingDialog({ |
|
|
|
/> |
|
|
|
/> |
|
|
|
</> |
|
|
|
</> |
|
|
|
)} |
|
|
|
)} |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<Label htmlFor="own-inperson-invitees">{t('Invitees')} *</Label> |
|
|
|
|
|
|
|
<InviteePicker |
|
|
|
|
|
|
|
labelId="own-inperson-invitees" |
|
|
|
|
|
|
|
value={inviteePubkeys} |
|
|
|
|
|
|
|
onChange={setInviteePubkeys} |
|
|
|
|
|
|
|
placeholder={t('Search by name or npub…')} |
|
|
|
|
|
|
|
className="mt-1" |
|
|
|
|
|
|
|
max={MAX_CALENDAR_INVITEES} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<Label htmlFor="own-inperson-location"> |
|
|
|
<Label htmlFor="own-inperson-location"> |
|
|
|
{t('Location')} <span className="text-muted-foreground font-normal">({t('optional')})</span> |
|
|
|
{t('Location')} <span className="text-muted-foreground font-normal">({t('optional')})</span> |
|
|
|
@ -371,17 +383,6 @@ export function ScheduleInPersonMeetingDialog({ |
|
|
|
className="mt-1" |
|
|
|
className="mt-1" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
|
|
|
|
<Label htmlFor="own-inperson-invitees">{t('Invitees')} *</Label> |
|
|
|
|
|
|
|
<InviteePicker |
|
|
|
|
|
|
|
labelId="own-inperson-invitees" |
|
|
|
|
|
|
|
value={inviteePubkeys} |
|
|
|
|
|
|
|
onChange={setInviteePubkeys} |
|
|
|
|
|
|
|
placeholder={t('Search by name or npub…')} |
|
|
|
|
|
|
|
className="mt-1" |
|
|
|
|
|
|
|
max={MAX_CALENDAR_INVITEES} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
{formValid && previewDraft && ( |
|
|
|
{formValid && previewDraft && ( |
|
|
|
<div className="min-h-0 shrink-0"> |
|
|
|
<div className="min-h-0 shrink-0"> |
|
|
|
<Label className="mb-1 block">{t('Preview')}</Label> |
|
|
|
<Label className="mb-1 block">{t('Preview')}</Label> |
|
|
|
|