Skip to content

Instantly share code, notes, and snippets.

View altovoy's full-sized avatar

Luis Alejandro Torres Ibarra altovoy

View GitHub Profile
import { useDateSelect as defaultUseDateSelect } from "react-ymd-date-select"
import { useMemo } from "react"
const getMonthDays = (year, month) => {
return new Date(year, month, 0).getDate()
}
export const useDateSelect = (...params) => {
const dateSelect = defaultUseDateSelect(...params)
const { yearValue, monthValue, dayOptions: defaultDayOptions, dayValue, onDayChange } = dateSelect