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

@mas.io/mas-calendar

v1.0.3

Published

mas-calendar的行业小程序组件,支持行业不同场景的定制化日历组件需求

Readme

安装

tnpm install --save @alipay/mas-calendar

组件介绍

行业小程序日历组件,参考开源社区中的日历实现,结合mini-antui的日历样式,针对支付宝行业的各个不同场景进行定制化开发,满足业务需求。

参数说明

常规日历组件

| | 参数名称 | 填写要求 | 参数类型 | 参数说明 | 默认值 | 示例 | | --------------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------- | -------- | ------ | ---- | | insert | 必填 | Boolean | 日历是否插入到对应的页面节点中 | true | - | | lunar | 选填 | Boolean | 是否开启阴历日期 | false | - | | range | 选填 | Boolean | 是否支持范围选择 | false | - | | showHeader | 选填 | Boolean | 是否显示日历头部,包括月切换和星期的日期 | true | - | | showMonth | 选填 | Boolean | 是否显示月份背景 | true | - | | hideDisableItem | 选填 | Boolean | 是否展示disable状态的日期,超出当前月或者maxDay的范围都标记为disable状态,默认行为将disable状态的元素的样式修改 | false | - | | showToday | 选填 | Boolean | 是否展示"今天"标识 | true | - | | itemWidth | 选填 | String | 日历中每个日期元素的宽度 | '' | - | | itemHeight | 选填 | String | 日历中每个日期元素的高度 | '' | - | | maxDay | 选填 | Number | 月份中最大的数值,小于该值的定位disable状态 | 31 | - | | onChange | 选填 | function | 日期更改的回调函数 | - | - | | onMonthChange | 选填 | function | 月份按钮更改日历月份的回调函数 | - | - | | showChangeBtn | 选填 | Boolean | 是否显示时间切换按钮 | true | - | | showWeek | 选填 | Boolean | 是否展示周信息 | true | - | | showBackToday | 选填 | Boolean | 是否展示返回今天按钮 | true | - | | date | 选填 | String | 年-月-日,默认选中时间 | - | - | | startDate | 选填 | String | 年-月-日,限定选择的范围:起始时间 | - | - | | endDate | 选填 | String | 年-月-日,限定选择的范围:结束时间 | - | - | | disableDates | 选填 | Array | 需要禁用的日期列表,形如: ['yyyy-mm-dd'], 支持props到ui层的更新 | - | - | | customerHoliday | 选填 | Object | 设置假期数据内容,必须在创建时候传入,暂不支持动态修改,数据示例如下文,支持props到ui层的更新 | - | - | | tags | 选填 | Array | 设置日历中每个日期下面的说明文案,优先级高于lunar的文案显示,| - | [{ date: '2021-01-01', text: '信息' }] |

跨月度日历选择列表

| 参数名称 | 填写要求 | 参数类型 | 参数说明 | 默认值 | 示例 | | -------- | -------- | -------- | -------- | ------ | ---- | | startDate | 选填 | String | 日历列表的开始时间,以string格式为准 | - | - | | endDate | 选填 | String | 日历列表的结束时间,以string格式为准 | - | - | | date | 选填 | String | 年-月-日,默认选中时间 | - | - | | onChange | 选填 | String | 更改日期选择的回调 | - | - | | customerHoliday | 选填 | Object | 设置假期数据内容,必须在创建时候传入,暂不支持动态修改,数据示例如下文 | - | - | | range | 选填 | Boolean | 设置日历列表是否 | false | 回调返回值为{ before: 'yyyy-mm-dd', after: 'yyyy-mm-dd'} | | initialRange | 选填 | Object | 设置初始选择的起止时间 | { startDate: '', endDate: '' } | { startDate: '2021-01-01', endDate: '2021-01-05' } |

{
  2020: [
    ...
    {
      "name": "春节",
      "range": ["2020-01-19"],
      "type": "workingday"
    },
    {
      "name": "春节",
      "range": ["2020-01-24", "2020-01-30"],
      "type": "holiday"
    },
    {
      "name": "春节",
      "range": ["2020-02-01"],
      "type": "workingday"
    }
    ...
  ]
}

跨月度日历选择列表

DEMO预览 在 page.json 文件中添加组件依赖

{
  "usingComponents": {
    "mas-calendar-list": "@alipay/mas-calendar/es/mode/list/index"
  }
}

在 page.axml 中引用组件

<!-- 常规日历组件在页面使用方式 -->
  <mas-calendar-list 
    startDate="2020-04-08"
    endDate="2020-07-09"
    onChange="onChange"
  />

常规日历组件使用方式

DEMO预览 在 page.json 文件中添加组件依赖

{
  "usingComponents": {
    "mas-calendar": "@alipay/mas-calendar/es/index",
  }
}

在 page.js 中配置日历组件日期选择变化的回调函数, onChange,返回日期相关的参数

Page({
  data: {
   
  },
  onChange (e) {
    console.log(e);
  }
});

样式覆盖推荐方式说明

可以通过在外层的view上套一个class来增加内部元素的样式优先级,达到样式覆盖的目的例如

.custom-calendar-container {
  display: flex;
  align-items: center;
  justify-content: center;
  .mas-calendar {
    width: 700rpx;

    .mas-calendar-item__weeks-box {
      height: 100rpx;
    }
  }
}

Badges

TNPM version TNPM downloads