diff --git a/app/src/components/DateField.tsx b/app/src/components/DateField.tsx index 38ca51f..78e0d58 100644 --- a/app/src/components/DateField.tsx +++ b/app/src/components/DateField.tsx @@ -1,5 +1,6 @@ -// Interactive date field: quick chips (Today / Tomorrow / Next week) plus an -// expandable month calendar. Pure RN views — identical on Android, iOS, web. +// Interactive date field: quick chips (Today / Tomorrow / Next week, plus an +// optional Someday) and an expandable month calendar. Pure RN views — +// identical on Android, iOS, web. import { useMemo, useState } from "react"; import { Pressable, StyleSheet, Text, View } from "react-native"; import { haptic } from "../lib/haptics"; @@ -100,11 +101,14 @@ export default function DateField({ value, onChange, clearable, + someday, }: { label?: string; value: string | null; onChange: (v: string | null) => void; clearable?: boolean; + /** Offers a dateless "Someday" chip — the pile, not a day on the calendar. */ + someday?: { active: boolean; onPress: () => void }; }) { const [open, setOpen] = useState(false); const today = new Date(); @@ -134,6 +138,16 @@ export default function DateField({ }} /> ))} + {someday && ( + { + haptic.select(); + someday.onPress(); + }} + /> + )} q.v === value) ? friendlyDate(value) : "Pick a date…"} active={open} diff --git a/app/src/components/TaskForm.tsx b/app/src/components/TaskForm.tsx index e5118b3..b77d795 100644 --- a/app/src/components/TaskForm.tsx +++ b/app/src/components/TaskForm.tsx @@ -81,7 +81,20 @@ export default function TaskForm({ icon: "today", placeholder: "When", value: d.due_date ? friendlyDate(d.due_date) : null, - panel: onChange({ due_date })} clearable />, + panel: ( + onChange({ due_date })} + clearable + someday={{ + active: d.status === "someday", + onPress: () => + d.status === "someday" + ? onChange({ status: "next" }) + : onChange({ status: "someday", due_date: null }), + }} + /> + ), onClear: () => onChange({ due_date: null }), }, {