Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

Universal React component wrapper around Pikaday.js datepicker

Notifications You must be signed in to change notification settings

BiQ/react-pikaday-component

 
 

Repository files navigation

ReactPikadayComponent

build status npm version Download Count

Universal React component wrapper around Pikaday.js datepicker.

Install

npm install react pikaday react-pikaday-component --save

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import DatePicker from 'react-pikaday-component';

class App extends React.Component {
  constructor() {
    super();

    this.state = {};
  }

  onDateChange(date) {
    this.setState({ date });
  }

  render() {
    const { date } = this.state;

    return (
      <div>
        <DatePicker 
            placeholder="Select Date"
            format="YYYY/MM/DD"
            maxDate={new Date('2020-07-26')}
            value={new Date(date)}
            onChange={::this.onDateChange}
        />
    </div>
    );
  }
}

ReactDOM.render(
    <App />,
    document.getElementById('example')
);

Properties

  • value
  • onChange
  • valueLink
  • tabIndex
  • Pikaday configuration options (except onSelect and field)
  • other input attributes like className, name, placeholder, disabled and readOnly

MIT Licensed

About

Universal React component wrapper around Pikaday.js datepicker

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 97.1%
  • HTML 2.9%