0.0.3 • Published 5 years ago

tw-simple-calendar v0.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

tw-simple-calendar

Introduction

Let rc-calendar more easy to use and support minguo date
See the example at app.js with npm start

Calendar

import {Calendar} from "tw-simple-calendar";

<Calendar name="date" value={this.state.date} onChange={this.handleChange} showMinguoDate={true}/>
  • Properties
PropertyVersionIsRequired?DefaultDescription
localezhTWLanguage, Ex: import zhTW from 'tw-simple-calendar/lib/locale/zh_TW'
formatterYYYY-MM-DD HH:mm:ssDate format, Ex: Calendar.DEFAULT_DATE_TIME_FORMAT
disabledDatefalseIs disable date
disabledTimefalseIs disable time
calendarDefaultDatemoment()Default date of the calendar
showOktrueIs show OK button on the calendar
nameYThe name of input
valueYThe value of input, must be the one of object, array or string
onChangeYThe callback function for date change, only be triggered when the date is valid, the callback function will with argument {target: {name: \<name>, value: \<moment object>}}
hiddenCalendarfalseHide the calendar icon
showMinguoDatefalseIs show minguo date, used for TAIWAN usually
showErrorDATE_FINISHEDThe time to show error message, change the attribute by import {CalendarMsg} from "tw-simple-calendar"
datePickerStyleCalendar's style
onErrorThe callback function for error date
...Other input's attribute, Ex: className, style...