feat: display months with text instead of number
This commit is contained in:
@@ -8,6 +8,8 @@ import { useIntl } from "react-intl"
|
||||
import { dt } from "@/lib/dt"
|
||||
|
||||
import Select from "@/components/TempDesignSystem/Select"
|
||||
import useLang from "@/hooks/useLang"
|
||||
import { getLocalizedMonthName } from "@/utils/dateFormatting"
|
||||
import { rangeArray } from "@/utils/rangeArray"
|
||||
|
||||
import ErrorMessage from "../ErrorMessage"
|
||||
@@ -33,9 +35,10 @@ export default function DateSelect({ name, registerOptions = {} }: DateProps) {
|
||||
const month = watch(DateName.month)
|
||||
const day = watch(DateName.day)
|
||||
|
||||
const lang = useLang()
|
||||
const months = rangeArray(1, 12).map((month) => ({
|
||||
value: month,
|
||||
label: `${month}`,
|
||||
label: getLocalizedMonthName(month, lang),
|
||||
}))
|
||||
|
||||
const currentYear = new Date().getFullYear()
|
||||
|
||||
Reference in New Issue
Block a user