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

chakra-datetime-picker

v1.1.7

Published

A Datetimepicker Component designed for Chakra-UI

Downloads

87

Readme

chakra-datetime-picker

A Datetimepicker Component designed for Chakra-UI

Installation

npm i chakra-datetime-picker

# or

yarn add chakra-datetime-picker

Demo

Storybook

Description

This component utilize dayjs to support date and datetime input with Chakra-UI style

Props

DatePicker

| Props | Type | Description | | ---------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | cancelButtonProps | ButtonProps | Props of the cancel button | | cancelText | string | Text of the cancel button | | colorScheme | string | Color Scheme of the DatePicker Component | | currentLangKey | "en" | "zh" | "zh_cn" | localization key of dayjs, used to localize dayjs | | defaultValue | string | number | Dayjs | Default Value of the DatePicker | | disableTimestampAfter | number | false | Any datetime after this value will be disabled | | disableTimestampBefore | number | false | Any datetime before this value will be disabled | | format | string | formatter of dayjs | | isDisabled | boolean | Control is DatePicker disabled | | okButtonProps | ButtonProps | Props of the ok button | | okText | string | Text of the ok button | | onCancel | (day: Dayjs) => void | Action when click cancel button | | onChange | (formattedDay: string, day: Dayjs) => void | Action when select date | | onOk | (day: Dayjs) => void | Action when click Ok button | | picker | "anniversary" | "date" | Type of the DatePicker. "anniversary" type can select month and date only. "date" type can select year, month and date | | showCancelButton | boolean | Display control of the cancel button | | showOkButton | boolean | Display control of the ok button | | showSelectableDays | boolean | Display control of the Selectable days | | showTimeSelector | boolean | Display control of the Time Selector | | size | "sm" | "md" | "lg | Size of the DatePicker Component | | selectableDays | { format: string; text: string; timestamp: number | Dayjs } [] | Presets of dates. Can set display format and text. | | value | Dayjs | null | Date Value of the Component |

DatePickerInput

Includes all props of DatePicker

| Props | Type | Description | | ----------------------- | ---------------------------------------------- | ----------------------------------------------------- | | allowClear | boolean | Display control of the clear button | | datePickerDefaultIsOpen | boolean | Control the DatePicker component is opened by default | | datePickerIsOpen | boolean | Control the DatePicker component is opened | | inputProps | InputProps | Props of Chakra Input | | isInvalid | boolean | Control is DatePickerInput invalid | | name | string | Name of the DatePickerInput element | | onBlur | () => void | Action when DatePickerInput out of focus | | onClear | (formattedValue: string, value: Dayjs) => void | Action when clear button is clicked | | onFocus | () => void | Action then DatePickerInput in focus | | placeholder | string | Placeholder of DatePickerInput | | ref | Ref | Ref forward to DatePickerInput | | wrapPortal | boolean | Is DatePicker Wrapped by a Portal to document.body |

v2

A major overhaul of the current DatePicker is planned. The new version will includes updated UI, performance improve, and tidy up the component props.