npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-calendar-datetime-picker

v1.7.4

Published

A fast and small calendar for react

Downloads

2,477

Readme

react-calendar-datetime-picker

The Simple and fast English and Persian calender for React

version: "1.7.4" NPM JavaScript Style Guide

⚙️ Install

npm install react-calendar-datetime-picker
or
yarn add react-calendar-datetime-picker

⚡️ Usage

import { DtPicker } from 'react-calendar-datetime-picker'
import 'react-calendar-datetime-picker/dist/style.css'

const App = () => {
  const [date, setDate] = useState(null)
  return <DtPicker onChange={setDate} />
}

📄 Documentation

Documentation with examples

🎯 Features

  • Supports Gregorian and Jalali calender
  • Uses context api to share data
  • Supports three types of calender: single day - date range - multiple dates
  • Fully customizable
  • Supports maximum and minimum dates
  • Capability to add a list of disabled dates
  • Supports time for single and range type
  • Capability to mark weekends
  • Function called for change, open and close events
  • Supports Typescript

🔧 Props

|Property|Type|Required|Default|Description| |--- |--- |--- |--- |--- | |onChange|func|true|-|A function that returns an object of selected date/dates.| |initValue|Day | null||null|You can set a default value for your date using this property.| |type|string||single|You can choose the selection type that you need to use. There exist 3 types: "single", "range", "multi"| |local|string||en|This date picker supports both Gregorian and Jalali calenders.To select Gregorian calendar you have to set "local" to "en" and to "fa" for Jalali.| |withTime|boolean||false|Should you need to use time in your date picker you can set this prop to true.This prop works only in single and range types.| |showTimeInput|boolean||false|Helps you to show time in input date picker| |showWeekend|boolean||false|Marks weekends by changing the color.| |clearBtn|boolean||false|Add a button to your input to clear you calendar initial date/dates.| |isRequired|boolean||false|This prop makes your input as a required field in the form validation| |todayBtn|boolean||false|A button to move fast to the date of today in the calendar.| |onCalenderChange|func|||A callback that runs when the calendar value is changed| |onCalenderShow|func|||A callback that runs when the calendar opens| |onCalenderHide|func|||A callback that runs when the calendar closes| |maxDate|Day|||You can set this prop to limit the maximum date that the user can select.Periods partially overlapped by maxDate will also be selectable, although React-calendar-dateTime-picker will ensure that no later date is selected.| |minDate|Day|||You can set this prop to limit the minimum date that the user can select. Periods partially overlapped by minDate will also be selectable, although React-calendar-dateTime-picker will ensure that no earlier date is selected.| |disabledDates|Day[]|||A list of dates that you want the user not to select.| |isDisabled|boolean||false|Use to disable the calendar input| |yearListStyle|string||grid|Use to change year item list style(accepted value: grid, list)|

🎨 Customization

|Property|Type|Default|Description| |--- |--- |--- |--- | |placeholder|string|"select"|To change input date picker placeholder| |inputClass|string||To change calendar's input style| |clearBtnClass|string||To change calendar's clear button style| |calenderModalClass|string||To change calendar's main modal style| |headerClass|string||To change calendar's green header style| |timeClass|string||To change calendar's time view style| |daysClass|string||To change calendar's days view style| |monthsClass|string||To change calendar's months view style| |yearsClass|string||To change calendar's years view style| |NextBtnIcon|svg as component|">"|To change next month button icon.| |PreviousBtnIcon|svg as component|"<"|To change previous month button icon.| |nextMonthBtnTitle|string|"next"|To change next month button title(shows by hover).| |previousMonthBtnTitle|string|"previous"|To change previous month button title(shows by hover).| |fromLabel|string|"from"|Starting date label in input result(works only in range type).| |toLabel|string|"to"|Ending date label in input result(works only in range type).| |clockFromLabel|string|"from"|Title for starting time in the time component(works only in range type).| |clockToLabel|string|"to"|Title for ending time in the time component(works only in range type).| |clockLabel|string|"clock"|Label for time in the time component(works in single and range type).|

✔️ bundle size

You can check out this package bundle size in this Link

🙇 Special Thanks

Thanks to jalaali-js, the only dependency of this date picker.

📋 License

MIT © mehdinasiri