“Bereaksi Dokumentasi DatePicker” Kode Jawaban

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

Bereaksi Datepicker

npm install react-datepicker --save
Glamorous Gorilla

Bereaksi Dokumentasi DatePicker

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

React Date Picker

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

<DatePicker
  locale="es"
/>
Clear Coyote

Jawaban yang mirip dengan “Bereaksi Dokumentasi DatePicker”

Pertanyaan yang mirip dengan “Bereaksi Dokumentasi DatePicker”

Lebih banyak jawaban terkait untuk “Bereaksi Dokumentasi DatePicker” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya