🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

rolldate

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rolldate

rolldate 多格式、功能强大的移动端日期选择插件

Source
npmnpm
Version
2.1.4
Version published
Weekly downloads
240
-18.92%
Maintainers
1
Weekly downloads
 
Created
Source

rolldate npm

此插件为jquery-date的全新版本,主要为了解决旧版参数设计不够合理、滑动效率不高、依赖jquery、没有可选的主题风格等问题,并增加了回调函数,使插件有更大的灵活性。

2019/02/03重要版本更新

上一个版本为1.5.1, 新版本(从2.0.0开始)与此前版本的不同之处:

  • 将滑动插件由iscroll替换为better-scroll,提升了兼容性;
  • 改变了界面风格,操作更加方便;
  • 取消了rolldate.css文件,只需引入js即可;
  • 移除了主题风格、日期初始化的滑动时间设置;

注意2.0.0之前的版本将不再维护,如有需要请访问:旧版rolldate

演示

rolldate(下方直接扫码即可体验)

rolldate

使用方式

es6

import {Date as rolldate} from 'rolldate'
new rolldate({
  el:'#date'
})

commonJS

var rolldate = require('rolldate');
new rolldate.Date({
  el:'#date'
})

require.js

require(['rolldate'],function(rolldate){
  new rolldate.Date({
    el:'#date'
  })
})

browser

new rolldate.Date({
  el:'#date'
})

参数及方法

//完整示例
new rolldate.Date({
  el:'#date',
  format:'YYYY-MM-DD',
  beginYear:2000,
  endYear:2100,
  value:'2018-02-15',
  tapBefore:function(el){
    console.log('插件开始触发');
  },
  moveEnd:function(el,scroll){
    console.log('滚动结束');
  },
  confirmBefore:function(el,date){
    console.log('确定按钮触发');
  },
  confirmEnd:function(el,date){
    console.log('插件运行结束');
  }
 })

更多请查阅演示或dist/index.html

Keywords

date

FAQs

Package last updated on 08 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts