Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rolldate-full

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rolldate-full

rolldate Multi-format, powerful mobile date selection plugin

  • 3.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
338
increased by62.5%
Maintainers
1
Weekly downloads
 
Created
Source

rolldate-full npm npm

This plugin is a new version of rolldate (jquery-date). It is mainly used to solve the problem that the previous version of the parameter design is not reasonable, the sliding efficiency is not high, it depends on jquery, there is no optional theme style, and the callback function is added to make the plugin more flexible.

Usage

es6

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){
    new Rolldate({
      el:'#date'
    })
});

Options

nameRequiredDefaultsDescription
elNonullThe plugin's dom element is bound. The plugin uses document.querySelector internally.
You can also pass the dom element object directly. Only a single dom element is supported.
formatNo'YYYY-MM-DD'Date format, unlimited. Rule: year-YYYY month-MM day-DD hour-hh minute-mm second-ss separated by /,-, space,:, can be combined at will
typeMonthNo'numeric'shows the text value of the month. Values: 'numeric','text' (default 'numeric')
localeMonthNotextual names of the months to be displayed in the month column. Depends on typeMonth = 'text'. Сan be a string or an array. Example: "January_February_March_April_May_June_July_August_September_October_November_December" or ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
beginYearNo2000date start year
endYearNo2100date end year
valueNonullThe default value for date initialization, such as '2018-03-18'
langNoYear, month, day ...Configure plugin language, default: title: 'Select date', cancel: 'Cancel', confirm: 'Confirm',
year: 'year', month: ' Month ', day:' day ', hour:' hour ', min:' minute ', sec:' second '
minStepNo1Minutes are separated by specified number
initNonullCallback function before plugin trigger, return false can prevent plugin execution
moveEndNonullCallback function after plugin scroll, function returns a parameter (better-scroll instance)
confirmNonullThe callback function before the confirmation button is triggered, return false can prevent the plugin from executing,
return other values to modify the date, the function returns a parameter (the selected date)
cancelNonullCallback function triggered when the plugin cancels
triggerNo'tap'By default, tap is used to resolve the 300ms delay of mobile click events. You can select tap to replace tap. Note that using tap will prevent other bound click events from firing
showNononeactive trigger plugin, when trigger is tap, active trigger plugin should use this method
hideNoNoneProactively hide plugins

Example

let rd = new Rolldate({
    el: '#date',
    format: 'YYYY-MM-DD',
    beginYear: 2000,
    endYear: 2100,
    minStep:1,
    lang:{title:'Select date'},
    trigger:'tap',
    init: function() {
      console.log('plugin start');
    },
    moveEnd: function(scroll) {
      console.log('End of scroll');
    },
    confirm: function(date) {
      console.log('OK button trigger');
    },
    cancel: function() {
      console.log('Plug-in canceled');
    }
});
rd.show();
rd.hide();

Photo

example

Keywords

js-date date time ios-theme ios выбор даты роллер

Keywords

FAQs

Package last updated on 30 Sep 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc