jQuery 插件 timedropper datedropper 使用

jQuery 小插件 timedropper datedropper

datedropper

datedropper 官网地址
GitHub 地址:最新版 3.0
GitHub 地址:老版本:

使用说明

1. datedropper 老版本

datedropper 老版本可以在调用的时候就初始化一些操作
使用方法

<link rel="stylesheet" href="../datedroper/1.0/datedropper.css">
<script src="https://cdn.bootcss.com/jquery/1.10.0/jquery.js"></script>
<script src="../datedroper/1.0/datedropper.js"></script>

<input type="text" id="pickdate" />


$("#pickdate").dateDropper({
  'animate': true, // 展示动画效果,当设置为true时,选择器面板中的日期会做动画滚动到当前日期,默认是true。
  'init_animation': 'bounce', // 点击弹出面板时的动画效果,有fadeIn(默认), bounce, dropDown三种效果。
  'format': 'Y-m-d', // 格式化日期。
  'lang': 'zh',  // 语言,。
  'maxYear': '2000',  // 最大年份,默认当前年份。
  'minYear': '1990', // 最小年份,默认1970。
  // 'yearsRange': '150', // 年份范围,默认10年。
  // dateDropper:    // 还提供了皮肤样式的设置。
}); 

2. datedropper 3.0版本

datedropper 3.0版本是写在 input 标签内
使用方法

<link rel="stylesheet" href="../datedroper/3.0/datedropper.css">
<script src="https://cdn.bootcss.com/jquery/1.10.0/jquery.js"></script>
<script src="../datedroper/3.0/datedropper.js"></script>

<input type="text" id="pickdate" data-fx="true" data-fx-mobile="true"  data-format="Y-m-d" data-lang="zh"  data-format="Y-m-d"/>


属性说明默认值书写格式
default-dateThis option offers the possibility to set a starting date. Please note that you must follow this specific format (mm-dd-yyyy) to allow the matching to recognize month, day and year.Default: CURRENT DATEdata-default-date=“11-13-2016”
disabled-daysThis option offers the possibility to set a string of disabled days. So, separete all days by comma and the picker will convert them into an array. Please note that you must follow this specific format (mm/dd/yyyy) to allow the matching to recognize month, day and year.Default: falsedata-disabled-days=“12/13/2016,12/14/2016,12/15/2016”
formatThe date format the picker will write on the selected input.Default: “m-d-Y”data-format=“F S, Y”
fxIf set to true, the picker will run an initial state animation and all user changes are animated.Default: truedata-fx=“false”
fx-mobileAnimations could be very slow on some older smartphones. To prevent this, set this option to false to disable animations on any mobile viewport.Default: truedata-fx-mobile=“true”
init-setThis option changes the input value automatically, by default. Set to false to prevent it.data-init-set=“false”
langLanguages used for months and days of the week.Default: endata-lang=“it”
large-modeThis option enables to switch the size of the picker by clicking on the icon at the bottom or clicking on the day block.Default: falsedata-large-mode=“true”
large-defaultIf “data-large-mode” is set to true, this option shows the large view by default.Default: falsedata-large-default=“true”
lockThis option sets the date limit based on the assigned variable. If you set to “from”, you can’t select a date earlier than the current date. Opposed to this behavior, if it’s set to “to”, you can not select a date after the current date.Default: falsedata-lock=“from”
jumpIt groups years based on the value set(multiple). This option is enabled when you click on the year block, to accellerate the transition between years.Default: 10data-jump=“4”
max-yearThe highest year that the control will allow.Default: CURRENT YEARdata-max-year=“2030”
min-yearThe lowest year that the control will allow.Default: 1970data-min-year=“1800”
modalIf this option is set to true, the picker will be displayed centered, with a dark overlay in background.Default: falsedata-modal=“true”
themeSet the name of style that you have assigned on the stylesheet generated by the theme generator.data-theme=“my-style”
translate-modeIf it’s set to true, you can change the language by clicking on the icon at the bottom.Default: falsedata-translate-mode=“true”

timedropper


$("#time").timeDropper({
  meridians: false,   // 默认为 false
  format: 'HH:mm'
})

format 说明

ValueDescriptionResult
H24-hour format non-padded number0-24
h12-hour format non-padded number43112
HH24-hour format padded number00-24
hh12-hour format padded number43112
mNon-padded numeric minutes1-59
mmpadded numeric minutes01-59
alower case meridianam-pm
Aupper case meridianAM-PM

datedropper部分内容参考: 阿里云栖社区

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值