Gathering detailed insights and metrics for @deskpro/react-datepicker-hijri
Gathering detailed insights and metrics for @deskpro/react-datepicker-hijri
Gathering detailed insights and metrics for @deskpro/react-datepicker-hijri
Gathering detailed insights and metrics for @deskpro/react-datepicker-hijri
A simple and reusable datepicker component for React
npm install @deskpro/react-datepicker-hijri
Typescript
Module System
JavaScript (98.14%)
CSS (0.94%)
SCSS (0.79%)
Shell (0.1%)
HTML (0.02%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
4 Stars
1,362 Commits
9 Forks
8 Watchers
13 Branches
33 Contributors
Updated on Dec 03, 2024
Latest Version
1.5.1
Package Id
@deskpro/react-datepicker-hijri@1.5.1
Size
72.85 kB
Published on
Jun 29, 2020
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
4
65
A simple and reusable Datepicker component for React (Demo)
The package can be installed via NPM:
npm install @deskpro/react-datepicker-hijri --save
You’ll need to install react
, propTypes
, moment
and moment-hijri
separately since those dependencies aren’t included in the package. Below is a simple example of how to use the Datepicker in a React view. You will also need to require the CSS file from this package (or provide your own). The example below shows how to include the CSS from this package if your build system supports requiring CSS files (Webpack is one that does).
1import React from "react"; 2import DatePicker from "@deskpro/react-datepicker-hijri"; 3import moment from "moment-hijri"; 4 5import "@deskpro/react-datepicker-hijri/dist/react-datepicker.css"; 6 7// CSS Modules, react-datepicker-cssmodules.css 8// import '@deskpro/react-datepicker-hijri/dist/react-datepicker-cssmodules.css'; 9 10class Example extends React.Component { 11 constructor(props) { 12 super(props); 13 this.state = { 14 startDate: moment() 15 }; 16 this.handleChange = this.handleChange.bind(this); 17 } 18 19 handleChange(date) { 20 this.setState({ 21 startDate: date 22 }); 23 } 24 25 render() { 26 return ( 27 <DatePicker 28 selected={this.state.startDate} 29 onChange={this.handleChange} 30 calendar="hijri" 31 /> 32 ); 33 } 34}
The most basic use of the DatePicker can be described with:
1<DatePicker selected={this.state.date} onChange={this.handleChange} />
You can use onSelect
event handler which fires each time some calendar date has been selected
1<DatePicker selected={this.state.date} 2 onSelect={this.handleSelect} //when day is clicked 3 onChange={this.handleChange} //only when value has changed 4/>
onClickOutside
handler may be useful to close datepicker in inline
mode
See here for a full list of props that may be passed to the component. Examples are given on the main website.
You can also include a time picker by adding the showTimeSelect prop
1<DatePicker 2 selected={this.state.date} 3 onChange={this.handleChange} 4 showTimeSelect 5 dateFormat="LLL" 6/>
Times will be displayed at 30-minute intervals by default (default configurable via timeInterval prop)
More examples of how to use the time picker are given on the main website
The date picker relies on moment.js internationalization to localize its display components. By default, the date picker will use the locale globally set in moment, which is English. Locales can be changed in the following ways:
moment.locale(lang)
locale
propLocales can be further configured in moment with various customization options.
As of version 0.23, the weekdays
and weekStart
DatePicker props have been removed. Instead, they can be configured with the weekdaysMin
and week.dow
moment locale customization options.
We're always trying to stay compatible with the latest version of React. We can't support all older versions of React.
Latest compatible versions:
The date picker is compatible with the latest versions of Chrome, Firefox, and IE10+.
Unfortunately, it is difficult to support legacy browsers while maintaining our ability to develop new features in the future. For IE9 support, it is known that the classlist polyfill is needed, but this may change or break at any point in the future.
The master
branch contains the latest version of the Datepicker component. To start your example app, you can run yarn start
. This starts a simple webserver on http://localhost:8080.
You can run yarn test
to execute the test suite and linters. To help you develop the component we’ve set up some tests that cover the basic functionality (can be found in /tests
). Even though we’re big fans of testing, this only covers a small piece of the component. We highly recommend you add tests when you’re adding new functionality.
The examples are hosted within the docs folder and are ran in the simple app that loads the Datepicker. To extend the examples with a new example, you can simply duplicate one of the existing examples and change the unique properties of your example.
Copyright (c) 2017 HackerOne Inc. and individual contributors. Licensed under MIT license, see LICENSE for the full license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/11 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
95 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More