Bootstrap Date Picker MDB Pro component

Date picker is a React component that adds function of selecting time without necessity of typing it by hand.


Basic example



Basic usage:



import React from 'react';
import { MDBDatePicker, Container } from 'mdbreact';

class DatePickerPage extends React.Component  {
  getPickerValue = (value) => {
    console.log(value);
  }

  render() {
    return(
      <Container className="mt-5">
        <MDBDatePicker getValue={this.getPickerValue} />
      </Container>
    );
  }
};

export default DatePickerPage;

Note: Javascript numeration

Months in a JavaScript Date object are zero-indexed. Meaning, new Date(2015, 3, 20) is 20 April, 2016.

To stay consistent with this, whenever an integer is used in reference to a month, pickadate treats it as zero-indexed. Dates as strings are still parsed as expected.