Socket
Book a DemoInstallSign in
Socket

react-simple-calendar-date-picker

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-calendar-date-picker

react date picker component

1.0.24
latest
Source
npmnpm
Version published
Weekly downloads
23
Maintainers
1
Weekly downloads
 
Created
Source

react-simple-date-picker

ReactJs simple calendar date picker component

NPM JavaScript Style Guide

Install

npm i react-simple-calendar-date-picker --save

GitLab

https://gitlab.com/damjan89/react-simple-date-picker

Preview

Date-Calendar

Usage

React >= 16.9.0

import * as React from 'react'

import DatePickerCalendarComponent from 'react-simple-calendar-date-picker';
import 'react-simple-calendar-date-picker/src/assets/style.css';
class IndexComponent extends React.Component {
   constructor(){
    super();
    this.state = {
        dateValue: new Date()
    }
   }
/*
  * Name: ClickedOutside
  * Description: This function is called when user clicks outside calendar borders (useful when calendar is in popup)
  * Parameters: event
  * author: Nick Dam
  * */
  clickedOutside(event){
    //if calendar is in popup you can hide it here
  }
  /*
  * Name: valueChanged
  * Description: This function is called when user choose a date
  * Parameters: value -> Clicked Date
  * author: Nick Dam
  * */
  valueChanged(value){
    this.setState({
      dateValue: value
    });
  }
  render () {
    return (
        <div>
          <p>{this.state.dateValue.toString()}</p>
          <DatePickerCalendarComponent
                    value={this.state.dateValue}
                    clickedOutside={(e)=>this.clickedOutside(e)}
                    onChange={(val)=>this.valueChanged(val)}/>
        </div>
    )
  }
}

License

MIT © Nick Dam

Keywords

React

FAQs

Package last updated on 24 Sep 2019

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.