npm @rehookify/datepicker 5.2.0
Configuration update

latest releases: 6.6.8, 6.6.7, 6.6.6...
2 years ago
  • 🆕 update of the configuration value will update entities which rely on it.
const [locale, setLocale] = useState<'en' | 'uk'>('en');

const {
  data: { weekDays }
} = useDatePicker({
  locale: { locale }
});

const onSetEnLocale = () => setLocale('en');
const onSetUkLocale = () => setLocale('uk');

render (
  <>
    <button onClick={onSetEnLocale}>Set English Locale</button>
    <button onClick={onSetUkLocale}>Set Ukrainian Locale</button>
    {weekDays.map((day) => (<div key={day}>{day}</div>))}
  </>
) 

After the user will click on any button locale and weekDays value will be changed.

Don't miss a new datepicker release

NewReleases is sending notifications on new releases.