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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@moluoxixi/daterangepicker

v1.3.16

Published

DateRangePicker 组件

Readme

DateRangePicker 日期范围选择器组件

基于Element Plus DatePicker封装的增强型日期选择器组件,支持基础日期选择和日期范围选择。

基础示例

<template>
  <DateRangePicker v-model="dateRange" type="daterange" :default-today="true" format="YYYY-MM-DD" />
</template>

<script setup>
import { ref } from 'vue'
const dateRange = ref<string[]>([])
</script>

Props

| 属性名 | 类型 | 默认值 | 说明 | | ----------------- | --------------- | --------------------- | ----------------------------------------------------------------------------------------------------- | | modelValue | Array | [] | 绑定值(单值返回字符串;范围返回字符串数组) | | type | String | 'date' | 'date' / 'datetime' / 'daterange' / 'datetimerange' | | format | String | 'YYYY-MM-DD' | 显示在输入框中的格式 | | valueFormat | String | 'YYYY-MM-DD HH:mm:ss' | 绑定值的格式(对显示无效) | | outputFormat | String | String[] | 根据 type 自动推断 | 控制内部格式化的起止时间格式(与显示无关)。当 type 不是 datetime/datetimerange 时,默认补齐为 ['YYYY-MM-DD 00:00:00','YYYY-MM-DD 23:59:59'];当 typedatetime/datetimerange 时,默认 ['YYYY-MM-DD HH:mm:ss','YYYY-MM-DD HH:mm:ss']。若需要返回带时分秒的字符串,请传 "YYYY-MM-DD HH:mm:ss"。 | | placeholder | String | '请选择日期' | 非范围选择时的占位内容 | | startPlaceholder | String | '开始日期' | 范围选择时开始日期的占位内容 | | endPlaceholder | String | '结束日期' | 范围选择时结束日期的占位内容 | | defaultToday | Boolean | true | 无选定值时默认返回今天的范围 | | dateRange | Number | Number[] | null | null | 数字/区间:正数=今天到未来n;负数=过去n到今天;数组[-n,m] | | dateRangeType | String | 'day' | 偏移单位:day/week/month/year 等 | | dateRangeBaseDate | String | Object| 当前日期 | 计算偏移的基准日期 | | minDate | String | Object| null | 最小可选日期 | | maxDate | String | Object| null | 最大可选日期 | | disabledDateRange | Array | null | 禁用区间:[minDate, maxDate],优先于单独的 minDate/maxDate | | datetimeDisableTypes | Array<'hours'|'minutes'|'seconds'> | ['hours','minutes','seconds'] | 根据最小/最大边界禁用时分秒 | | shortcuts | Boolean | Array| false | 是否显示快捷项或自定义快捷项 |

Events

| 事件名 | 说明 | 回调参数 | | --- | --- | --- | | update:modelValue | 绑定值更新 | (value: string[] | string) => void | | change | 用户确认选定时触发 | (value: string[] | string) => void |

Slots

该组件不提供插槽。

Expose

| 名称 | 说明 | 类型 | | --- | --- | --- | | focus | 使 input 获取焦点 | () => void | | blur | 使 input 失去焦点 | () => void |