Coder Social home page Coder Social logo

react-bootstrap-date-picker's Introduction

React-Bootstrap based date picker.

NPM Version Circle CI Coverage Status Dependency Status NPM Downloads

See the demo at pushtell.github.io/react-bootstrap-date-picker.

Demo

Please โ˜… on GitHub!

Table of Contents

Installation

react-bootstrap-date-picker is compatible with React 0.14.x and 0.15.x.

npm install react-bootstrap-date-picker

Usage

var DatePicker = require("react-bootstrap-date-picker");

var App = React.createClass({
  getInitialState: function(){
    var value = new Date().getISOString();
    return {
      value: value
    }
  },
  handleChange: function(value) {
    // value is an ISO String.
    this.setState({
      value: value
    });
  },
  render: function(){
    return <div>
      <DatePicker value={this.state.value} onChange={this.handleChange} />
    </div>;
  }
});

API Reference

<DatePicker />

DatePicker component. Renders as a react-bootstrap input element.

Input element properties are passed through to the input element.

  • Properties:
    • dateFormat - Date format. "MM/DD/YYYY" or "DD/MM/YYYY" or "YYYY/MM/DD"
      • Optional
      • Type: string
      • Example: "MM/DD/YYYY"
    • clearButtonElement - Character or component to use for the clear button.
      • Optional
      • Type: string or ReactClass
      • Example: "ร—"
    • previousButtonElement - Character or component to use for the calendar's previous button.
      • Optional
      • Type: string or ReactClass
      • Example: "<"
    • nextButtonElement - Character or component to use for the calendar's next button.
      • Optional
      • Type: string or ReactClass
      • Example: ">"
    • cellPadding - CSS padding value for calendar date cells.
      • Optional
      • Type: string
      • Example: "2px"
    • dayLabels - Array of day names to use in the calendar. Starting on Sunday.
      • Optional
      • Type: array
      • Example: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
    • monthLabels - Array of month names to use in the calendar.
      • Optional
      • Type: array
      • Example: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
    • calendarPlacement - Overlay placement for the popover calendar.
      • Optional
      • Type: string
      • Example: "top"

Tests

Browser Coverage

Karma tests are performed on Browserstack in the following browsers:

  • IE 9, Windows 7
  • IE 10, Windows 7
  • IE 11, Windows 7
  • Opera (latest version), Windows 7
  • Firefox (latest version), Windows 7
  • Chrome (latest version), Windows 7
  • Safari (latest version), OSX Yosemite
  • Mobile Safari (latest version), iPhone 6, iOS 8.3

Please let us know if a different configuration should be included here.

Running Tests

Locally:

npm test

On Browserstack:

BROWSERSTACK_USERNAME=YOUR_USERNAME BROWSERSTACK_ACCESS_KEY=YOUR_ACCESS_KEY npm test

react-bootstrap-date-picker's People

Contributors

wehriam avatar

Watchers

 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.