Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7efc4079d | ||
|
|
1ff78418ec |
@@ -9,8 +9,8 @@
|
||||
"buildType": "apk"
|
||||
},
|
||||
"env": {
|
||||
"VERSION_CODE": "17",
|
||||
"VERSION_NAME": "1.17"
|
||||
"VERSION_CODE": "18",
|
||||
"VERSION_NAME": "1.18"
|
||||
},
|
||||
"node": "22.20.0"
|
||||
}
|
||||
|
||||
@@ -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 && (
|
||||
<OptionChip
|
||||
label="Someday"
|
||||
active={someday.active}
|
||||
onPress={() => {
|
||||
haptic.select();
|
||||
someday.onPress();
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<OptionChip
|
||||
label={value && !quick.some((q) => q.v === value) ? friendlyDate(value) : "Pick a date…"}
|
||||
active={open}
|
||||
|
||||
@@ -81,7 +81,20 @@ export default function TaskForm({
|
||||
icon: "today",
|
||||
placeholder: "When",
|
||||
value: d.due_date ? friendlyDate(d.due_date) : null,
|
||||
panel: <DateField value={d.due_date} onChange={(due_date) => onChange({ due_date })} clearable />,
|
||||
panel: (
|
||||
<DateField
|
||||
value={d.due_date}
|
||||
onChange={(due_date) => 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 }),
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user