1.0.24 • Published 6 years ago
react-simple-calendar-date-picker v1.0.24
react-simple-date-picker
ReactJs simple calendar date picker component
Install
npm i react-simple-calendar-date-picker --save
GitLab
https://gitlab.com/damjan89/react-simple-date-picker
Preview
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
1.0.24
6 years ago
1.0.23
6 years ago
1.0.22
6 years ago
1.0.21
6 years ago
1.0.20
6 years ago
1.0.19
6 years ago
1.0.18
6 years ago
1.0.17
6 years ago
1.0.16
6 years ago
1.0.15
6 years ago
1.0.14
6 years ago
1.0.13
6 years ago
1.0.12
6 years ago
1.0.11
6 years ago
1.0.10
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago