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

rc-calendar-picker

v0.0.10

Published

<div align="center"> <a href="https://github.com/noxxxxxxxx/calendar" target="_blank"> <img alt="Calendar Logo" width="150" src="https://github.com/noxxxxxxxx/calendar/blob/main/public/calendar.svg"/> </a> </div>

Downloads

23

Readme

A lightweight but complete calendar picker react component.

API

| Name | Type | Default | Description | | ------------------- | ---------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | value | Dayjs | undefined | Represents the selected date by the component, in order to use it as a controlled component. This prop is parsed by dayjs, so it is possible to use a date string or a dayjs object. | | initialValue | Dayjs | undefined | Represents the selected date for the component to use it as a uncontrolled component. This prop is parsed by Dayjs, so it is possible to use a date string or a dayjs object. If you need to set the selected date programmatically after the picker is initialized, please use the value prop instead. | | initialViewMode | string | day | The default view to display when the picker is shown for the first time ('year', 'month', 'day', 'time'). If you want to set the view mode after the component has been initialize see the imperative API. | | showInput | boolean | true | Whether to show an input field to edit the date manually. | | open | boolean | undefined | Whether to open or close the picker. If not set react-calendar will open the datepicker on input focus and close it on click outside. | | onChange | function | empty function | Callback trigger when the date changes. The callback receives the selected dayjs object as only parameter, if the date in the input is valid. If the date in the input is not valid, the callback receives the value of the input (a string). | | onOpen | function | empty function | Callback trigger for when the user opens the calendar. | | onClose | function | empty function | Callback trigger for when the calendar get closed. The callback receives the selected dayjs object as only parameter, if the date in the input is valid. If the date in the input is not valid, the callback returns the value in the input. | | closeOnSelect | boolean | false | When true, once the day has been selected, the datepicker will be automatically closed. | | onNavigate | function | empty function | Callback trigger when the view mode changes. The callback receives the selected view mode string (year, month, day or time) as only parameter. | | onBeforeNavigate | function | ( nextView, currentView, viewDate ) => nextView | Allows to intercept a change of the calendar view. The accepted function receives the view that it's supposed to navigate to, the view that is showing currently and the date currently shown in the view. Return a viewMode ( default ones are year, month, day or time) to navigate to it. If the function returns a "falsy" value, the navigation is stopped and we will remain in the current view. | | onNavigateBack | function | empty function | Callback trigger when the user navigates to the previous month, year or decade. The callback receives the amount and type ('month', 'year') as parameters. | | onNavigateForward | function | empty function | Callback trigger when the user navigates to the next month, year or decade. The callback receives the amount and type ('month', 'year') as parameters. | | className | string or string[] | '' | Extra class name for the outermost markup element. | | inputProps | object | undefined | Defines additional attributes for the input element of the component. For example: onClick, placeholder, disabled, required, name and className (className sets the class attribute for the input element). See Customize the Input Appearance. | | isValidDate | function | () => boolean | Define the dates that can be selected. The function receives (currentDate, selectedDate) and shall return a true or false whether the currentDate is valid or not. See selectable dates. | | dateFormat | boolean or string | true | Defines the format for the date. It accepts any dayjs time format. If true the date will be displayed using the defaults for the current locale. If false the datepicker is disabled and the component can be used as timepicker. | | timeFormat | boolean or string | true | Defines the format for the time. It accepts any dayjs time format. If true the time will be displayed using the defaults for the current locale. If false the timepicker is disabled and the component can be used as datepicker. | | closeOnClickOutside | boolean | true | When the calendar is open and closeOnClickOutside is true (its default value), clickin outside of the calendar or input closes the calendar. If false the calendar stays open. |

How to use

Develop

pnpm i

npm run dev

Test

npm run test

npm run coverage

LICENSE

This repository is published under MIT license