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

@aurouscia/vue-lunar-date-select

v0.5.1

Published

vue3公历农历联动日期选择器

Readme

vue3公农双历日期选择器

由6个select标签组成的日期选择器组件,需要自定义样式和布局
第一组3个为公历年月日,第二组3个为农历年月日
两组select标签会互相联动,选择其中一个,另一个会自动选择对应的日期
例如:
| 年 | 月 | 日 | | --- | --- | --- | | 2025 年 | 5 月 | 22 日 | | 2025 乙巳年 | 四月 | 廿五 |

(实际使用时并没有表头)

安装

npm install @aurouscia/vue-lunar-date-select

使用

<template>
    <div class="myContainer">
        <LunarDateSelect
            :range-from="[2000, 1, 1]"
            :range-to="'tomorrow'"
            :init="[2025, 6, 1]"
            @changed="changedHandler"
        ></LunarDateSelect>
    </div>
</template>

Props

  • range-from 必填,日期选择器的最小可选公历日期
  • range-to 必填,日期选择器的最大可选公历日期
  • init 可选,初始化选中的公历日期,默认为当前日期

以上三个属性可为:

  • 公历日期数组(长度为3),例如:[2025, 6, 1]
  • 描述相对时间的三种字符串:
    • 'today':当前日期
    • 'tomorrow':明天
    • 'yesterday':昨天
  • 相对于当前日期的天数偏移量,例如:-1表示昨天,1表示明天
  • Date对象
  • tyme4tsSolarDay对象

初始化不会触发@changedemit,但:
如果init超出range-fromrange-to的范围,初始化时会被自动调整到最接近的日期同时触发emit输出矫正后的值

Emits

  • @changed 可选,日期选择器值改变时触发的事件,返回值为当前选中的公历日期数组(长度为3),例如:[2025, 6, 1]

Expose

  • initByProps() 调用后,使用当前的Props值重新初始化整个选择器(覆盖当前值)若改变了当前值,会触发emit
  • getEmitData() 获取当前值,与@changed获取的相同

自定义样式

本组件不提供任何样式,需自定义样式布局请在外面套上容器,并编写非scopedstyle标签,例如:

.myContainer{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}
.myContainer>div{
    display: flex;
    flex-wrap: wrap;
}
.myContainer select{
    font-size: 18px;
    min-width: 80px;
}

其中.myContainer表示两组选择器外的容器
.myContainer>div表示每一组选择器本身的容器
.myContainer select表示每一个select标签

<template>
    <div class="myContainer">
        <LunarDateSelect></LunarDateSelect>
    </div>
</template>

将会变成:

<div class="myContainer">
    <div>
        <select></select>
        <select></select>
        <select></select>
    </div>
    <div>
        <select></select>
        <select></select>
        <select></select>
    </div>
</div>

依赖项

使用tyme4ts进行可选日期获取和公农历转换计算

反馈与建议

欢迎在gitee上提issue,我会及时更新

许可证

MIT