Socket
Socket
Sign inDemoInstall

@lendinghome/react-pikaday

Package Overview
Dependencies
44
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @lendinghome/react-pikaday

A React component wrapper around Pikaday.


Version published
Maintainers
1
Created

Readme

Source

react-pikaday

A component wrapper around Pikaday.

View Example

Importing

Normal

If you're using Browserify, or want to bring a custom Pikaday stylesheet, just require this component like any other module:

var Pikaday = require('react-pikaday');

Bundled

If you're using webpack with a configured style-loader for CSS, you can actually require this component along with the Pikaday CSS in one go:

var Pikaday = require('react-pikaday/bundled');

Usage

/** @jsx React.DOM */
var React = require('react');
var Pikaday = require('react-pikaday');

var MyComponent = React.createClass({
  getInitialState: function() {
    return {
      date: null
    };
  },

  handleChange: function(date) {
    this.setState({
      date: date
    });
  },

  render: function() {
    var date = this.state.date;

    return (
      <div>
        <p>
          The date is {date.toDateString()}
        </p>
        <Pikaday value={date} onChange={this.handleChange} />
      </div>
    );
  }
});

Properties

valueA Date object to set the currently-displayed date to.
onChange A callback called when the date is updated by the user. Passes a Date object as the first argument.
valueLink Instead of manually hooking up value/onChange to a state variable, you can instead use LinkedStateMixin to bind the two.

FAQs

Last updated on 07 Dec 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc