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

@nejadipour/react-modern-datepicker

v1.2.3

Published

Modern datepicker for React with support of both gregorian and jalali calendar

Downloads

7

Readme

react-modern-datepicker

A simple and reusable Datepicker component for React.
This package is an updated version of react-modern-calendar-datepicker with some additional features and bug fixes.

Installation

npm install @nejadipour/react-modern-datepicker

Usage

import Datepicker from "@nejadipour/react-modern-datepicker";

export default function Usage() {
    return (
        <Datepicker darkMode locale={"fa"}/>
    )
}

Documentation

You can find the base documentation here. Some additional features are added to the original package, you can find the properties details in the table below:

| Prop | Type | Default | Description | |-------------------------------|----------|-----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | alwaysOpen | boolean | false | If true, the datepicker will always be open | | arrow | boolean | true | If true, the arrow will be shown in the Popover | | calendarClassName | String | '' | Additional CSS class for the calendar element | | calendarRangeBetweenClassName | String | '' | Additional CSS class for the range-between day(s) in the range date picker | | calendarRangeEndClassName | String | '' | Additional CSS class for the range end day in the range date picker | | calendarRangeStartClassName | String | '' | Additional CSS class for the range start day in the range date picker | | calendarSelectedDayClassName | String | '' | Additional CSS class for the selected day | | calendarTodayClassName | String | '' | Additional CSS class for today day | | closedView | String | 'text' | The view that is shown when the date picker is closed. It can be one of 'text', 'button' and 'input'. alwaysOpen should be False | | closedViewClassName | String | '' | Additional CSS class for the closed view element | | closedViewProps | Object | {} | Additional props for the closed view element based on Ant Design components. | | colorPrimary | String | '#1677ff' | The color of selected day in the single date picker and the color of range start and range end in range date picker | | colorPrimaryLight | String | '#64a9f9' | The color of range-between days | | customDaysClassName | Array | [] | An array of custom class names for your days. Each item is an object which contains day(number), month(number), year(number), and className(string) properties | | darkMode | Boolean | False | If True, the date picker will be in dark mode | | defaultValue | Object | null | The default value of the date picker. It should be an object with year, month, and day or an string of them separated by the delimiter. Based on the selectionMode, it can be an array or object with from and to | | delimiter | String | '-' | The delimiter that separates year, month, and day in the date string. This is shown when the datepicker is closed | | disabled | Boolean | False | If True, the date picker will be disabled | | disabledDays | Array | [] | An array of disabled calendar days. Disabled days won't be selectable, and they can't be included in a day range. If user tries to select/include them onDisabledDayError will be called | | locale | String | 'en' | Locale language of the calendar. It can be one of 'fa' or 'en' | | maximumDate | Object | null | Specifies the maximum selectable day by user | | maximumToday | Boolean | False | If True, the maximum date will be set to today | | maximumTomorrow | Boolean | False | If True, the maximum date will be set to tomorrow | | minimumDate | Object | null | Specifies the minimum selectable day by user | | minimumToday | Boolean | False | If True, the minimum date will be set to today | | minimumTomorrow | Boolean | False | If True, the minimum date will be set to tomorrow | | onChange | Function | newValue => null | Gets called when the value of the picker changes | | onDisabledDayError | Function | disabledDay => null | Gets called when user tries to select/include a disabled day | | onRenderReady | Function | () => null | Gets called when the date picker render is ready or changed | | placeholder | String | 'select' for 'en' and 'انتخاب' for 'fa' | The placeholder of the date picker | | placement | String | 'bottom' | The placement of the date picker. It can be one of 'top', 'bottom', 'left', 'right', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight', 'leftTop', 'leftBottom', 'rightTop' or 'rightBottom' | | popover | Boolean | true | If true, the date picker will be open in a popover, else it will be replaced with the closed view | | renderFooter | Function | () => null | Renders a footer for the calendar below the days list. You can use this prop to render a "Go to Today" button or anything you'd like to add there. | | returnType | String | 'string' | The type of the when calling onChange. It can be one of 'string' or 'object' | | selectionMode | String | 'single' | The selection mode of the date picker. It can be one of 'single', 'range', or 'multiple' | | selectorEndingYear | Number | current year + 50 | The maximum selectable year when user opens the year selector | | selectorStartingYear | Number | current year - 100 | The minimum selectable year when user opens the year selector | | shouldHighlightWeekends | Boolean | false | Determines whether to mark weekend days with red or not. (weekend days are Saturday and Sunday for locale="en" calendar and Friday for locale="fa" calendar) | | slideAnimationDuration | String | '0.4s' | Duration of month slide animation. It can be any CSS valid time value | | trigger | String | "click" | The trigger of the date picker to open/close it. It can be one of "click", "hover", "focus" or "contextMenu" | | wrapperClassName | String | '' | Additional CSS class for the date picker wrapper element |