Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-persian-dates

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-persian-dates - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

2

package.json
{
"name": "react-persian-dates",
"version": "1.0.9",
"version": "1.0.10",
"description": "",

@@ -5,0 +5,0 @@ "author": "majid-amiri",

@@ -18,3 +18,3 @@ # react-persian-dates

import MyComponent from 'react-persian-dates'
import Datepicker from 'react-persian-dates'

@@ -24,3 +24,5 @@ class Example extends Component {

return (
<MyComponent />
<Datepicker
onSelect={this.handleChange}
/>
)

@@ -31,4 +33,65 @@ }

## Props
|Props name|Desciption|Values|Default value|
|--------------------|--------------------|------------------|-----------------|
|monthsCount|Number of months shown in date picker|(Number)|12
|startDate|The date that calendar use to start generating|(Date)|```new Date()```|
|selectFrom|The date that is marked when date picker appears|(Date)|```new Date()```|
|selectTo|The date that is marked as second date (usable in range date picker)|(Date)|null|
|onSelect|Function that returns a value when marked dates are changed in date picker|(Function)|null|
|rangeSelect|Specify if date picker is single or range|(Boolean)|false|
|scrollToSelectedDay|A function that returns the selected date element. (#1. Refer to examples) (#2. You can use it for scrolling to selected day)|(Function)|undefined|
## Example
```jsx
import React, { Component } from 'react'
import Datepicker from 'react-persian-dates'
class Example extends Component {
constructor(props) {
super(props);
this.state = {
from: new Date(),
to: null,
};
}
handleChange = value => {
this.setState({
from: value.from,
to: value.to,
});
};
render () {
const { from, to } = this.state;
return (
<Datepicker
rangeSelect={true}
startDate={new Date()}
selectFrom={from}
selectTo={to}
onSelect={this.handleChange}
scrollToSelectedDay={day =>
setTimeout(
() =>
window.scrollTo({
top: day.offsetTop - 200,
left: 0,
behavior: 'smooth',
}),
500,
)
}
/>
)
}
}
```
## License
MIT © [majid-amiri](https://github.com/majid-amiri)
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc