2 Commits

  1. 2
      src/app/questions-list/page.tsx
  2. 36
      src/components/Componentes/question-date.tsx
  3. 2
      src/hooks/marriage/use-match-start.ts

2
src/app/questions-list/page.tsx

@ -180,7 +180,7 @@ export default function QuestionsListPage() {
}
}
await queryClient.invalidateQueries();
queryClient.invalidateQueries();
startMatchMutation.mutate();
} catch (err) {
console.error("Failed to sync pending sections:", err);

36
src/components/Componentes/question-date.tsx

@ -12,18 +12,18 @@ type QuestionDateProps = {
};
const MONTHS = [
{ value: "01", label: "January" },
{ value: "02", label: "February" },
{ value: "03", label: "March" },
{ value: "04", label: "April" },
{ value: "05", label: "May" },
{ value: "06", label: "June" },
{ value: "07", label: "July" },
{ value: "08", label: "August" },
{ value: "09", label: "September" },
{ value: "10", label: "October" },
{ value: "11", label: "November" },
{ value: "12", label: "December" },
{ value: "01", label: "01 - January" },
{ value: "02", label: "02 - February" },
{ value: "03", label: "03 - March" },
{ value: "04", label: "04 - April" },
{ value: "05", label: "05 - May" },
{ value: "06", label: "06 - June" },
{ value: "07", label: "07 - July" },
{ value: "08", label: "08 - August" },
{ value: "09", label: "09 - September" },
{ value: "10", label: "10 - October" },
{ value: "11", label: "11 - November" },
{ value: "12", label: "12 - December" },
];
const DAYS = Array.from({ length: 31 }, (_, i) => {
@ -48,6 +48,16 @@ export function QuestionDate({
const value = getAnswerValue(question);
const dateValue = typeof value === "string" ? value : "";
const months = useMemo(() => {
return MONTH_VALUES.map((val, idx) => {
const date = new Date(2000, idx, 15);
const label = new Intl.DateTimeFormat(`${locale}-u-ca-gregory`, {
month: "long",
}).format(date);
return { value: val, label };
});
}, [locale]);
const [selectedYear, setSelectedYear] = useState(() => {
const parts = dateValue ? dateValue.split("-") : [];
return parts[0] || "";
@ -166,7 +176,7 @@ export function QuestionDate({
className="h-[54px] w-full cursor-pointer rounded-[16px] border border-[#D0D5DD] bg-white px-3 text-[15px] font-medium text-[#181818] outline-none transition-all hover:border-[#98A2B3] focus:border-[#6F6F6F] focus:ring-1 focus:ring-[#6F6F6F]"
>
<option value="">Month</option>
{MONTHS.map((m) => (
{months.map((m) => (
<option key={m.value} value={m.value}>
{m.label}
</option>

2
src/hooks/marriage/use-match-start.ts

@ -23,7 +23,7 @@ export function useStartMarriageMatchMutation(
...options,
mutationFn: startMarriageMatch,
onSuccess: async (data, variables, onMutateResult, context) => {
await Promise.all([
Promise.all([
queryClient.invalidateQueries({
queryKey: marriageQueryKeys.profile(),
}),

Loading…
Cancel
Save