Browse Source

fix date calendar events

imwald
Silberengel 1 month ago
parent
commit
9fdb98ccff
  1. 4
      package-lock.json
  2. 2
      package.json
  3. 29
      src/components/ScheduleVideoCallDialog/ScheduleInPersonMeetingDialog.tsx

4
package-lock.json generated

@ -1,12 +1,12 @@ @@ -1,12 +1,12 @@
{
"name": "imwald",
"version": "23.5.0",
"version": "23.5.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "imwald",
"version": "23.5.0",
"version": "23.5.1",
"license": "MIT",
"dependencies": {
"@asciidoctor/core": "^3.0.4",

2
package.json

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
{
"name": "imwald",
"version": "23.5.0",
"version": "23.5.1",
"description": "Imwald — a user-friendly Nostr client focused on relay feed browsing, publications, and relay discovery",
"private": true,
"type": "module",

29
src/components/ScheduleVideoCallDialog/ScheduleInPersonMeetingDialog.tsx

@ -67,7 +67,8 @@ export function ScheduleInPersonMeetingDialog({ @@ -67,7 +67,8 @@ export function ScheduleInPersonMeetingDialog({
if (inviteePubkeys.length === 0 || inviteePubkeys.length > MAX_CALENDAR_INVITEES) return false
if (eventType === 'date') {
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
}
if (!startDatetime.trim()) return false
@ -84,7 +85,7 @@ export function ScheduleInPersonMeetingDialog({ @@ -84,7 +85,7 @@ export function ScheduleInPersonMeetingDialog({
const d = 'preview'
if (eventType === 'date') {
if (!startDateStr.trim()) return null
if (endDateStr.trim() && endDateStr <= startDateStr) return null
if (endDateStr.trim() && endDateStr < startDateStr) return null
return createInPersonDateBasedCalendarEventDraftEvent({
d,
title: title.trim() || t('In-person meeting'),
@ -147,7 +148,7 @@ export function ScheduleInPersonMeetingDialog({ @@ -147,7 +148,7 @@ export function ScheduleInPersonMeetingDialog({
toast.error(t('Please set a start date'))
return
}
if (endDateStr.trim() && endDateStr <= startDateStr) {
if (endDateStr.trim() && endDateStr < startDateStr) {
toast.error(t('End date must be after start date'))
return
}
@ -322,6 +323,17 @@ export function ScheduleInPersonMeetingDialog({ @@ -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>
<Label htmlFor="own-inperson-location">
{t('Location')} <span className="text-muted-foreground font-normal">({t('optional')})</span>
@ -371,17 +383,6 @@ export function ScheduleInPersonMeetingDialog({ @@ -371,17 +383,6 @@ export function ScheduleInPersonMeetingDialog({
className="mt-1"
/>
</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 && (
<div className="min-h-0 shrink-0">
<Label className="mb-1 block">{t('Preview')}</Label>

Loading…
Cancel
Save