All Components

DateInputs Overview

The DateInputs enable the user to pick up dates for scheduling appointments.

Basic Usage

The following example demonstrates the Calendar and DateInput components in action.

class App extends React.Component {
    state = { value: new Date() };

    render() {
        return (
            <div className="row example-wrapper" styles={{ minHeight: 450 }}>
                <div className="col-xs-12 col-md-6 example-col">
                    <p>DateInput</p>
                    <DateInput
                        value={this.state.value}
                        onChange={this.changeDate}
                    />
                    <p>(use <code>←</code> and <code>→</code> to navigate, <code>↑</code> and <code>↓</code> to update)</p>
                    <p>DatePicker</p>
                    <DatePicker
                        value={this.state.value}
                        onChange={this.changeDate}
                    />
                    <p>(use Alt+<code>↓</code> to open the calendar, <code>←</code> and <code>→</code> to navigate, <code>↑</code> to increment and <code>↓</code> to decrement the value)</p>
                </div>
                <div className="col-xs-12 col-md-6 example-col">
                    <Calendar
                        value={this.state.value}
                        onChange={this.changeDate}
                    />
                </div>
            </div>
        );
    }

    changeDate = ({ value }) => {
        this.setState({ value });
    }
}

ReactDOM.render(
    <App />,
    document.querySelector('my-app')
);

Installation

  1. Download and install the package. Use Node.js v5.0.0 or later.

    npm install --save @progress/kendo-react-dateinputs @progress/kendo-react-intl
  2. Once installed, import the package module.

    // ES2015 module syntax
    import { DateInput, Calendar, DatePicker } from '@progress/kendo-react-dateinputs';
    // CommonJS format
    const { DateInput, Calendar, DatePicker } = require('@progress/kendo-react-dateinputs');
  3. You are required to install one of the Kendo UI themes for React to style your components. For more information on how to add the styles, refer to the article on getting started.

Dependencies

The DateInputs package requires you to install the following peer dependencies in your application:

  • react
  • react-dom
In this article