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

@hi-ui/date-picker

v4.6.3

Published

A sub-package for @hi-ui/hiui.

Downloads

467

Readme

DatePicker 日期选择器

用于接收日期和时间类型的容器。

何时使用

需要将某一个日期或时间录入到系统中时

需要将某一个时间段或任一个时间周期录入到系统中时

使用示例

Props

| 参数 | 说明 | 类型 | 可选值 | 默认值 | | ----------------- | --------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | | type | 选择器类型 | string | date 普通日期 daterange 日期范围 year 年份 month 月份 week 周 weekrange 周范围 timeperiod 时间段(1.5 新增) yearrange 年范围(2.13 新增) monthrange 月范围(2.13 新增) | date | | defaultValue | 默认显示的日期 | Date | string | number| DateRange | undefined | null | - | null | | value | 日期 | Date | string | number| DateRange | undefined | null | - | null | | width | 输入框宽度 | number | - | auto | | minDate | 最小日期 | Date | null | null | | maxDate | 最大日期 | Date | null | null | | disabled | 是否禁用输入框 | boolean | true | false | false | | bordered | 是否有边框 | boolean | true | false | true | | inputReadOnly | 设置输入框为只读 | boolean | true | false | false | | disabledDate | 不可选择的日期(返回true为不可选) | (currentDate: Date) => boolean | - | () => false | | min | 最小日期 | Date | null | null | | max | 最大日期 | Date | null | null | | clearable | 是否可以清空 | boolean | true | false | true | | showTime | 是否在日期选择器中显示时间选择器,在使用时请注意 format 的设置 | boolean | true | false | false | | timeInterval | 时间段的间隔,以分钟为单位 | number | 1 ~ 1440 分钟 | 240 | | format | 展示的日期格式,配置参考 moment.js | string | - | - | | shortcuts | 快捷面板 | string[] | { title: string,range: (Date | number)[]}[] | 近一周, 近一月, 近三月, 近一年 | null | | weekOffset | 周起始,默认周日做为第一列(3.3.0版本后,优化为根据中英文自动设置周起始) | number | 0 | 1 | 0 | | placeholder | 自定义占位符(数组用于范围日期) | string | string[] | - | - | | altCalendar | 自定义日期中历法展示信息 | CalendarItem | - | 农历 & 假日 | | altCalendarPreset | 预置历法信息(支持中国农历和印度节假日) | string | 'zh-CN' | 'id-ID' | 'zh-CN' | | dateMarkRender | 自定义日期的右上角标记 | (currentDate: Date, today: Date) => React.ReactNode | - | - | | dateMarkPreset | 预置日期的右上角标记(休 | 班) | string | 'zh-CN' | 'zh-CN' | | overlayClassName | 下拉根元素的类名称 (3.0 新增) | string | - | - | | disabledHours | 禁止选择的小时,仅在 showTime 开启时生效 | (() => number[]) | number[] | - | - | | disabledMinutes | 禁止选择的分钟,仅在 showTime 开启时生效 | ((selectedHour: number) => number[]) | number[] | - | - | | disabledSeconds | 禁止选择的秒数,仅在 showTime 开启时生效 | ((selectedHour: number, selectedMinute: number) => number[]) | number[] | - | - |

CHANGELOG

| 参数 | 变更类型 | 变更内容 | 解决的问题 | | ------------ | ------ | ---------------- | ----------------------------- | | disabledDate | update | 函数增加 view 参数 | 解决无法得知当前正在使用哪个视图,该如何确定禁用数据的问题 | | weekOffset | update | 变更其功能含义,只负责周计算方式 | 解决现在周计算方式与语言绑定的问题 |