Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(reminders): migrate reminder schedule dates to the DatePicker seam (#65996)

Paul D'Ambra20af2cf3e366
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index eaf977e19a50..5ed89476b9a2 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -6688,6 +6688,10 @@ snapshots:
hash: v1.k794b7964.8e074309fead3a6e5abf2b263f02d5117c0a8e3130d0ac6bddd7456942b8976c.IOEnXxWVDhORglv-Z8IDtXuO89NWwgRd9z0o3jglg0E
scenes-app-settings-user--settings-user-profile--light:
hash: v1.k794b7964.e4738c59cb0a887733f0e1184ed95f6c1121d4957972271c62751879ed7d9905.iYs2mcf-aLhqJZPHK60Bt0lJHYdWpP21M3fC2kCoRIk
+ scenes-app-settings-user--settings-user-reminders-modal--dark:
+ hash: v1.k794b7964.a47d11ce213bbd41bec7534af79f065316b34e6565747d299e73f1991aa8ac6b.F2BXFXa1jnVeSs-vXg8CGTaPlt-yRW6TyfgoGOlU-ko
+ scenes-app-settings-user--settings-user-reminders-modal--light:
+ hash: v1.k794b7964.23cdeccf9d38cc5e5033e986ab9372d1db6e1fe71b39f4cedec000eeade4ceb9.WA7AM_B5I4s5ydGspkg-8DvQAjxF1NdVoQTaH_eLfEs
scenes-app-sidepanels--side-panel-access-control--dark:
hash: v1.k794b7964.80fd4cbed7d99893eabb98d53d5f24b11dd4aecfc3fbcb8915be38cf6f950447.C0WODvsCDwbz9_2H9yhAixqz1ikKJsc8z0Y3vIBnxJk
scenes-app-sidepanels--side-panel-access-control--light:
diff --git a/frontend/src/scenes/settings/stories/SettingsUser.stories.tsx b/frontend/src/scenes/settings/stories/SettingsUser.stories.tsx
index f02b8452c357..5169cf6d1c0b 100644
--- a/frontend/src/scenes/settings/stories/SettingsUser.stories.tsx
+++ b/frontend/src/scenes/settings/stories/SettingsUser.stories.tsx
@@ -1,6 +1,8 @@
import { MOCK_DEFAULT_TEAM } from 'lib/api.mock'
import type { Meta, StoryObj } from '@storybook/react'
+import { within } from '@testing-library/dom'
+import userEvent from '@testing-library/user-event'
import { router } from 'kea-router'
import { useEffect } from 'react'
@@ -76,3 +78,11 @@ export const SettingsUserCustomization: Story = {
export const SettingsUserDangerZone: Story = {
args: { sectionId: 'user-danger-zone' },
}
+
+export const SettingsUserRemindersModal: Story = {
+ args: { sectionId: 'user-reminders' },
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement)
+ await userEvent.click(await canvas.findByText('New reminder'))
+ },
+}
diff --git a/frontend/src/scenes/settings/user/Reminders.tsx b/frontend/src/scenes/settings/user/Reminders.tsx
index c7e6b061d2ad..e3f406772c36 100644
--- a/frontend/src/scenes/settings/user/Reminders.tsx
+++ b/frontend/src/scenes/settings/user/Reminders.tsx
@@ -4,9 +4,9 @@ import { Form } from 'kea-forms'
import { IconPencil, IconPlus, IconTrash } from '@posthog/icons'
import { LemonButton, LemonInput, LemonModal, LemonSelect, LemonTable, LemonTag } from '@posthog/lemon-ui'
+import { DatePicker } from 'lib/components/DatePicker/DatePicker'
import { TZLabel } from 'lib/components/TZLabel'
import { dayjs } from 'lib/dayjs'
-import { LemonCalendarSelectInput } from 'lib/lemon-ui/LemonCalendar/LemonCalendarSelect'
import { LemonDialog } from 'lib/lemon-ui/LemonDialog'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { LemonInputSelect } from 'lib/lemon-ui/LemonInputSelect/LemonInputSelect'
@@ -108,14 +108,13 @@ function ReminderModal(): JSX.Element {
{reminderForm.scheduleType === 'one-off' && (
<LemonField name="scheduled_at" label="Fires at">
{({ value, onChange }) => (
- <LemonCalendarSelectInput
+ <DatePicker
value={value ? dayjs(value) : null}
onChange={(date) => onChange(date ? date.toISOString() : null)}
granularity="minute"
placeholder="Select date and time"
- buttonProps={{
- disabledReason: !isScheduleEditable ? 'This reminder has already fired' : undefined,
- }}
+ maxDate={dayjs().add(10, 'year')}
+ disabledReason={!isScheduleEditable ? 'This reminder has already fired' : undefined}
/>
)}
</LemonField>
@@ -149,15 +148,14 @@ function ReminderModal(): JSX.Element {
{reminderForm.scheduleType !== 'one-off' && (
<LemonField name="end_date" label="Ends" info="Optional. The reminder stops after this time.">
{({ value, onChange }) => (
- <LemonCalendarSelectInput
+ <DatePicker
value={value ? dayjs(value) : null}
onChange={(date) => onChange(date ? date.toISOString() : null)}
granularity="minute"
placeholder="No end date"
clearable
- buttonProps={{
- disabledReason: !isScheduleEditable ? 'This reminder has already fired' : undefined,
- }}
+ maxDate={dayjs().add(10, 'year')}
+ disabledReason={!isScheduleEditable ? 'This reminder has already fired' : undefined}
/>
)}
</LemonField>