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

rolldate-nhs

v3.1.4

Published

rolldate: A versatile and powerful mobile date picker plugin

Downloads

5

Readme

rolldate npm npm

This plugin is a new version of jquery-date, primarily designed to address issues such as unreasonable parameter design, low scrolling efficiency, dependency on jQuery, lack of optional theme styles, etc. It also introduces callback functions for greater flexibility.

Version 3.0 Update (2019/05/24)

The previous version was 2.1.5. Changes in the new version (starting from 3.0.0):

  1. The usage changed from new rolldate.Date to new Rolldate.
  2. Callback functions were adjusted: tapBefore renamed to init, confirmBefore renamed to confirm, confirmEnd removed, and cancel added.
  3. The date format (format) is now unrestricted and can be freely combined according to rules.

Important Version Update (2019/02/03)

The previous version was 1.5.1. The new version (starting from 2.0.0) differs from earlier versions in the following ways:

  1. Replaced the scrolling plugin from iscroll to better-scroll, improving compatibility.
  2. Changed the interface style for easier operation.
  3. Removed the rolldate.css file; only the JS file needs to be included.
  4. Removed theme styles and sliding time settings for date initialization.

Note: Versions prior to 2.0.0 will no longer be maintained. For previous versions, please visit: Old rolldate

Demo

Experience the rolldate (scan the QR code below for a direct experience):

rolldate

Usage

ES6

import Rolldate from 'rolldate';
new Rolldate({
  el: '#date'
});


## 使用方式
### es6
```js
import Rolldate from 'rolldate'
new Rolldate({
  el:'#date'
})

commonJS

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

amd

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

cmd

seajs.use('rolldate',function(undefined){
    //插件没有遵循cmd规范,这里的Rolldate是全局的
    new Rolldate({
      el:'#date'
    })
});

参数、方法说明

Name|Required|Default|Description ---|:-:|:-:|--- el|No|None|The DOM element to which the plugin is bound. The plugin uses document.querySelector internally. You can also directly pass a DOM element object, only supports a single element. format|No|'YYYY-MM-DD'|Date format, no restrictions. Rules: Year-YYYY Month-MM Day-DD Hour-hh Minute-mm Second-ss AM/PM-A Use one of /, -, space, : as separators, can be freely combined. beginYear|No|2000|Start year of the date endYear|No|2100|End year of the date value|No|None|Default value for date initialization, e.g., '2018-03-18' lang|No|Year, Month, Day...|Configure the plugin language, default: title:'Select Date', cancel:'Cancel', confirm:'Confirm',year:'Year', month:'Month', day:'Day', hour:'Hour', min:'Minute', sec:'Second' minStep|No|1|Minutes are divided by the specified number init|No|null|Callback function before the plugin is triggered, return false to prevent the plugin from executing moveEnd|No|null|Callback function after the plugin scrolls, the function returns one parameter (better-scroll instance) confirm|No|null|Callback function before the confirm button is triggered, return false to prevent the plugin from executing, return other values to modify the date, the function returns one parameter (selected date) cancel|No|null|Callback function triggered when the plugin is canceled trigger|No|'tap'|Default is to use tap to solve the 300ms delay of the click event on mobile devices, you can choose click to replace tap. Note that using tap will prevent other bound click events from being triggered show|No|None|Actively trigger the plugin, when trigger is tap, actively trigger the plugin should use this method hide|No|None|Actively hide the plugin

//完整参数、方法示例
var rd = new Rolldate({
    el: '#date',
    format: 'YYYY-MM-DD',
    beginYear: 2000,
    endYear: 2100,
    minStep:1,
    lang:{title:'自定义标题'},
    trigger:'tap',
    init: function() {
      console.log('插件开始触发');
    },
    moveEnd: function(scroll) {
      console.log('滚动结束');
    },
    confirm: function(date) {
      console.log('确定按钮触发');
    },
    cancel: function() {
      console.log('插件运行取消');
    }
})
rd.show();
rd.hide();