1.0.4 • Published 10 months ago

tuo-date-picker v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

tuo-date-picker (react)

react date-picker

Screenshot

light-calendar

Development

npm install
yarn install

npm run dev
yarn dev

Install

npm install tuo-date-picker
yarn add tuo-date-picker

Usage

const [date, setDate] = useState<Date>(new Date());

return (
  <datePicker
    selectedDate={date}
    onDateChange={setDate}
  />
)

API

DatePicker props

namedescriptiontypedefalut
languagelanguage of header and day text'en' / 'ko' / 'zh''en'
selectedDatecurrently selected dateDate
onDateChangechanging selectedDate when selecting a date(date:Date) => void
disableDateClickdisable selecting a datebooleanfalse
disableFuturedisable moving to future months from the current monthbooleanfalse
containerSizesize of the container including the header and calendar{width: string, height: string}{width: '100%', height: '100%'}
cellSizewidth and height of the selection area and today's date area (px)number40
cellColorbackground color of each of the selection area and today's date area{today: stirng, selected: string}{today: '#EDEDED', selected: '#ADD8E6'}
selectedFontColorfont color of the selected datestring'#333333'
classNamesadditional css class of calendar container and the cell for day and date{contanier: stirng, day?: string, current?: string, date?: string, differentMonth?: string, sunday?: string, future?: string}
customHeadercustomize the header(dateText: string, handleMonth: (direction: 'prev''next') => void, clickToday: () => void, futureDisabled: boolean) => JSX.Element

Don't use version 1.0.0