useDateState(initialState: number | Date | (() => Date)): [Date, Dispatch<Date | number>]
This simulates the logic of useState but the input is a Date or a number representing the instant.
It will always provide a Date and may NOT be null. However, the initial state if it is a function must
be return a Date.
Since null is not a supported value, designate a constant like Date(0) to represent an undefined state.
This simulates the logic of useState but the input is a Date or a number representing the instant. It will always provide a Date and may NOT be null. However, the initial state if it is a function must be return a Date.
Since null is not a supported value, designate a constant like
Date(0)
to represent an undefined state.