Git Product home page Git Product logo

rc-datetime-picker's Introduction

Rc-Datetime-Picker

Rc-Datetime-Picker is a react component for datetime picker by Moment.js.

Requirements

  • React
  • Moment.js
  • Modern browsers (IE>=9 is required)

Installation

Install with NPM

$ npm install rc-datetime-picker

Manual download

Besides npm package, UMD module is placed under dist/ directory:

  • dist/rc-datetime-picker.js
  • dist/rc-datetime-picker.min.js

Usage

See the demo page.

Props

DatetimePicker Props

Name Type Default Description
moment moment Set the selected date.
onChange Function(datetime: moment) `onChange` will be triggered while datetime changing.
className String Additional css class of root dom node.
isOpen Boolean true Whether to show the picker.
showCalendarPicker Boolean true Whether to show the calendar picker.
showTimePicker Boolean true Whether to show the time picker.
splitPanel Boolean false Enable `split-panel` mode.
shortcuts Object:{name: value} Add shortcuts on the top `shortcuts-bar` for selecting a date.
maxDate moment Max Date limit.
minDate moment Min Date limit.
weeks Array ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] Text for weekdays.
months Array [Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] Text for months.
dayFormat String 'MMMM, YYYY' Formatting current date of the day panel.
minPanel String 'day' Min panel for select.

DatetimePickerTrigger Props

Name Type Default Description
moment moment Set the selected date.
onChange Function(datetime: moment) `onChange` will be triggered while datetime changing.
className String Additional css class of root dom node.
showCalendarPicker Boolean true Whether to show the calendar picker.
showTimePicker Boolean true Whether to show the time picker.
splitPanel Boolean false Enable `split-panel` mode.
shortcuts Object:{name: value} Add shortcuts on the top `shortcuts-bar` for selecting a date.
maxDate moment Max Date limit.
minDate moment Min Date limit.
weeks Array ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] Text for weekdays.
months Array [Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] Text for months.
dayFormat String 'MMMM, YYYY' Formatting current date of the day panel.
appendToBody Boolean false Whether to render the picker to `body`.
closeOnSelectDay Boolean false Whether to close the picker when selecting a date on day panel.
disabled Boolean false Disabled triggering.
minPanel String 'day' Min panel for select.

DatetimeRangePicker Props

Name Type Default Description
moment Object: {start: moment, end: moment} Set the selected date range.
onChange Function(datetime: {start: moment, end: moment}) `onChange` will be triggered while confirm button or shortcuts clicked.
className String Additional css class of root dom node.
showCalendarPicker Boolean true Whether to show the calendar picker.
showTimePicker Boolean false Whether to show the time picker.
splitPanel Boolean false Enable `split-panel` mode.
shortcuts Object:{name: {start: moment, end: moment}} Add shortcuts on the top `shortcuts-bar` for selecting a date range.
maxDate moment Max Date limit.
minDate moment Min Date limit.
weeks Array ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] Text for weekdays.
months Array [Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] Text for months.
dayFormat String 'MMMM, YYYY' Formatting current date of the day panel.
format String 'YYYY/MM/DD HH:mm' / 'YYYY/MM/DD' Formatting current date of each panel.
showCustomButton Boolean false Whether to show the custom button.
customButtonText String Custom Text for custom button.
customRange Object: {start: moment, end: moment} Last 30 days Set the custom button value.
confirmButtonText String Confirm Text for confirm button.
startDateText String Start Date: Text for start date label.
endDateText String End date: Text for end date label.
dateLimit Object: {name: value} Date range limt.
minPanel String 'day' Min panel for select.

DatetimeRangePickerTrigger Props

Name Type Default Description
moment Object: {start: moment, end: moment} Set the selected date range.
onChange Function(datetime: {start: moment, end: moment}) `onChange` will be triggered while confirm button or shortcuts clicked.
className String Additional css class of root dom node.
showCalendarPicker Boolean true Whether to show the calendar picker.
showTimePicker Boolean false Whether to show the time picker.
splitPanel Boolean false Enable `split-panel` mode.
shortcuts Object:{name: {start: moment, end: moment}} Add shortcuts on the top `shortcuts-bar` for selecting a date range.
maxDate moment Max Date limit.
minDate moment Min Date limit.
weeks Array ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] Text for weekdays.
months Array [Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] Text for months.
dayFormat String 'MMMM, YYYY' Formatting current date of the day panel.
format String 'YYYY/MM/DD HH:mm' / 'YYYY/MM/DD' Formatting current date of each panel.
showCustomButton Boolean false Whether to show the custom button.
customButtonText String Custom Text for custom button.
customRange Object: {start: moment, end: moment} Last 30 days Set the custom button value.
confirmButtonText String Confirm Text for confirm button.
startDateText String Start Date: Text for start date label.
endDateText String End date: Text for end date label.
dateLimit Object: {name: value} Date range limt.
appendToBody Boolean false Whether to render the picker to `body`.
disabled Boolean false Disabled triggering.
minPanel String 'day' Min panel for select.

rc-datetime-picker's People

Contributors

allenwooooo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.