“React Documentation DatePicker” Réponses codées

react-datepicker

// npm install react-datepicker --save


import React, { useState } from 'react'
import './App.css'
import DatePicker from 'react-datepicker'
import 'react-datepicker/dist/react-datepicker.css'

function App () {
  const [selectedDate, setSelectedDate] = useState(null)
  return (
    <div className='App'>
      <DatePicker
        selected={selectedDate}
        onChange={date => setSelectedDate(date)}
        placeholderText={'dd/mm/yyyy'}
        filterDate={date => date.getDay() !== 6 && date.getDay() !== 0} // weekends cancel
        showYearDropdown // year show and scrolldown alos
        scrollableYearDropdown
      />
    </div>
  )
}

export default App
Abhishek

react datepicker

npm install react-datepicker --save
Glamorous Gorilla

React Documentation DatePicker

() => {
  const [startDate, setStartDate] = useState(new Date());
  return (
    <DatePicker selected={startDate} onChange={(date) => setStartDate(date)} />
  );
};
Stragen Horsecorn

Picker de date de réaction

import { registerLocale, setDefaultLocale } from  "react-datepicker";
import es from 'date-fns/locale/es';
registerLocale('es', es)

<DatePicker
  locale="es"
/>
Clear Coyote

Réponses similaires à “React Documentation DatePicker”

Questions similaires à “React Documentation DatePicker”

Plus de réponses similaires à “React Documentation DatePicker” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code