文档章节

移动端日期选择插件

o
 osc_isezqdgg
发布于 2019/09/18 16:33
字数 5885
阅读 16
收藏 0

精选30+云产品,助力企业轻松上云!>>>

index.html

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>rolldate demo</title>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <style type="text/css">
        h1{font-size:30px;}
        .form-control[readonly]{background:none;}
        @media(max-width:414px){.form-control{font-size:12px;}}
        @media(max-width:360px){.form-control{font-size:10px;padding:0 5px;}}
        @media(max-width:320px){.col-xs-6 {padding:0 5px;}}
    </style>
</head>
<body>

<div class="container">
<h4><strong>支持格式:(无限制)</strong></h4>
<p><strong>规则:年-YYYY 月-MM 日-DD 时-hh 分-mm 秒-ss 使用/、-、空格、:之一分隔,可以随意组合,不建议单个重复</strong></p>
<p>例:YYYY-MM、YYYY-MM-DD、YYYY-MM-DD hh:mm、YYYY-MM-DD hh:mm:ss、YYYY、MM、DD、hh:mm、hh:mm:ss、YYYY-MM-DD hh、hh、mm、ss、YYYY/DD...</p>

<div class="row">
    <div class="form-group clearfix">
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group1-1" placeholder="YYYY-MM">
        </div>
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group1-2" placeholder="YYYY-MM-DD">
        </div>
    </div>

    <div class="form-group clearfix">
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group1-3" placeholder="YYYY-MM-DD hh">
        </div>
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group1-4" placeholder="YYYY-MM-DD hh:mm">
        </div>
    </div>

    <div class="form-group clearfix">
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group1-5" placeholder="YYYY-MM-DD hh:mm:ss">
        </div>
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group1-6" placeholder="hh:mm">
        </div>
    </div>

    <div class="form-group clearfix">
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group1-7" placeholder="hh:mm:ss">
        </div>
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group1-8" placeholder="YYYY">
        </div>
    </div>

    <div class="form-group clearfix">
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group1-9" placeholder="MM">
        </div>
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group1-10" placeholder="DD">
        </div>
    </div>

    <div class="form-group clearfix">
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group1-11" placeholder="hh">
        </div>
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group1-12" placeholder="mm">
        </div>
    </div>

    <div class="form-group clearfix">
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group1-13" placeholder="ss">
        </div>
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group1-14" placeholder="YYYY/DD">
        </div>
    </div>
</div>

<h4><strong>回调函数:</strong></h4>
<p>init、moveEnd、confirm、cancel</p>

<div class="row">
    <div class="form-group clearfix">
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group2-1" placeholder="完整实例">
        </div>
    </div>
    <h5 class="col-xs-12">init return false可阻止插件运行</h5>
    <div class="form-group clearfix">
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group2-2" placeholder="init">
        </div>
    </div>
    <h5 class="col-xs-12">confirm return false阻止插件运行,return其他值可以修改日期展示</h5>
    <div class="form-group clearfix">
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group2-3" placeholder="confirm修改日期">
        </div>
    </div>
</div>

<h4><strong>自定义语言</strong></h4>
<p>lang</p>
<div class="row">
    <div class="form-group clearfix">
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group3-1" placeholder="lang">
        </div>
    </div>
</div>

<h4><strong>设置默认日期</strong></h4>
<p>value</p>
<div class="row">
    <div class="form-group clearfix">
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group4-1" placeholder="设置默认日期">
        </div>
    </div>
</div>

<h4><strong>el传dom对象</strong></h4>
<div class="row">
    <div class="form-group clearfix">
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group5-1" placeholder="el传dom对象">
        </div>
    </div>
</div>

<h4><strong>分钟间隔</strong></h4>
<div class="row">
    <div class="form-group clearfix">
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group6-1" placeholder="分钟间隔5">
        </div>
    </div>
</div>

<h4><strong>使用原生click</strong></h4>
<div class="row">
    <div class="form-group clearfix">
        <div class="col-xs-6">
            <input readonly class="form-control" type="text" id="date-group7-1" placeholder="trigger:'click'">
        </div>
    </div>
</div>

</div>

<script type="text/javascript" src="rolldate.min.js"></script>
<script>
    window.onload = function() {

        // 格式
        new Rolldate({
            el: '#date-group1-1',
            format: 'YYYY-MM',
            beginYear: 2000,
            endYear: 2100
        })
        new Rolldate({
            el: '#date-group1-2',
            format: 'YYYY-MM-DD',
            beginYear: 2000,
            endYear: 2100
        })
        new Rolldate({
            el: '#date-group1-3',
            format: 'YYYY-MM-DD hh'
        })
        new Rolldate({
            el: '#date-group1-4',
            format: 'YYYY-MM-DD hh:mm',
            beginYear: 2000,
            endYear: 2100
        })
        new Rolldate({
            el: '#date-group1-5',
            format: 'YYYY-MM-DD hh:mm:ss',
            beginYear: 2000,
            endYear: 2100
        })
        new Rolldate({
            el: '#date-group1-6',
            format: 'hh:mm'
        })
        new Rolldate({
            el: '#date-group1-7',
            format: 'hh:mm:ss'
        })
        new Rolldate({
            el: '#date-group1-8',
            format: 'YYYY',
            beginYear: 2000,
            endYear: 2100
        })
        new Rolldate({
            el: '#date-group1-9',
            format: 'MM'
        })
        new Rolldate({
            el: '#date-group1-10',
            format: 'DD'
        })
        new Rolldate({
            el: '#date-group1-11',
            format: 'hh'
        })
        new Rolldate({
            el: '#date-group1-12',
            format: 'mm'
        })
        new Rolldate({
            el: '#date-group1-13',
            format: 'ss'
        })
        new Rolldate({
            el: '#date-group1-14',
            format: 'YYYY/DD'
        })
        /* 回调函数
         * tips:    在vue及其他mvvm框架中使用时,在confirm中修改v-model绑定的数据即可
         */
        new Rolldate({
            el: '#date-group2-1',
            format: 'YYYY-MM-DD',
            beginYear: 2000,
            endYear: 2100,
            init: function() {
                console.log('插件开始触发');
            },
            moveEnd: function(scroll) {
                console.log(scroll)
                console.log('滚动结束');
            },
            confirm: function(date) {
                console.log(date)
                console.log('确定按钮触发');
            },
            cancel: function() {
                console.log('插件运行取消');
            }
        })
        new Rolldate({
            el: '#date-group2-2',
            format: 'YYYY-MM-DD',
            beginYear: 2000,
            endYear: 2100,
            init: function() {
                if (1 == 1) {
                    console.log('阻止插件继续执行');
                    return false;
                }
            }
        })
        new Rolldate({
            el: '#date-group2-3',
            format: 'YYYY-MM-DD',
            beginYear: 2000,
            endYear: 2100,
            confirm: function(date) {
                return date.replace(/-/g, '/');
            }
        })
        // 自定义语言
        var lang = {
            title: '自定义标题',
            cancel: '取消',
            confirm: '确认',
            year: '',
            month: '',
            day: '',
            hour: '',
            min: '',
            sec: ''
        };
        // 如果某个值未修改可不传 以上同 var lang = {title:'自定义标题'} 允许传空串
        new Rolldate({
            el: '#date-group3-1',
            format: 'YYYY-MM-DD',
            beginYear: 2000,
            endYear: 2100,
            lang: {title:'自定义标题哈哈哈哈哈'}
        })

        // 设置默认日期 内部使用document.getElementById('date').bindDate = new Date('2019/05/13');
        new Rolldate({
            el: '#date-group4-1',
            format: 'YYYY-MM-DD',
            beginYear: 2000,
            endYear: 2100,
            value: '2017-10-21' //或2017-10-21 23:52:50
        })

        // el传dom对象,只支持单个
        new Rolldate({
            el: document.getElementById('date-group5-1'),
            format: 'YYYY-MM-DD',
            beginYear: 2000,
            endYear: 2100
        })

        // 分钟按指定数分隔
        new Rolldate({
            el: '#date-group6-1',
            format: 'hh:mm',
            minStep: 5
        })
        // 使用原生click
        new Rolldate({
            el: '#date-group7-1',
            trigger: 'click'
        })

        // 其他示例
        //日期判断
        new Rolldate({
            el: '#date-group8-1',
            format: 'YYYY-MM-DD',
            beginYear: 2000,
            endYear: 2100,
            confirm: function(date) {
                var d = new Date(),
                    d1 = new Date(date.replace(/\-/g, "\/")),
                    d2 = new Date(d.getFullYear() + '/' + (d.getMonth() + 1) + '/' + d.getDate()); //如果非'YYYY-MM-DD'格式,需要另做调整

                if (d1 < d2) {
                    alert('不能小于当前的日期');
                    return false;
                }
            }
        })
    }
</script>
</body>
</html>

 

rolldate.min.js

/** 
 * Rolldate 3.1.0
 * Copyright 2019
 * weijhfly https://github.com/weijhfly/rolldate
 * Licensed under MIT
 * Released on: aug 4, 2018
 */
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t=t||self).Rolldate=i()}(this,function(){"use strict";!function(t,i){void 0===i&&(i={});var e=i.insertAt;if(t&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===e&&o.firstChild?o.insertBefore(s,o.firstChild):o.appendChild(s),s.styleSheet?s.styleSheet.cssText=t:s.appendChild(document.createTextNode(t))}}("ul{margin:0;padding:0}li{list-style-type:none}.rolldate-container{font-size:20px;color:#333;text-align:center}.rolldate-container header{position:relative;line-height:60px;font-size:18px;border-bottom:1px solid #e0e0e0}.rolldate-container .rolldate-mask{position:fixed;width:100%;height:100%;top:0;left:0;background:#000;opacity:.4;z-index:999}.rolldate-container .rolldate-panel{position:fixed;bottom:0;left:0;width:100%;height:273px;z-index:1000;background:#fff;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-delay:0s;animation-delay:0s;-webkit-animation-iteration-count:1;animation-iteration-count:1}.rolldate-container .rolldate-btn{position:absolute;left:0;top:0;height:100%;padding:0 15px;color:#666;font-size:16px;cursor:pointer;-webkit-tap-highlight-color:transparent}.rolldate-container.wx .rolldate-btn{height:150%}.rolldate-container .rolldate-confirm{left:auto;right:0;color:#007bff}.rolldate-container .rolldate-content{position:relative;top:20px}.rolldate-container .rolldate-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.rolldate-container .rolldate-wrapper>div{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;height:173px;line-height:36px;overflow:hidden;-webkit-flex-basis:-8e;-ms-flex-preferred-size:-8e;flex-basis:-8e;width:1%}.rolldate-container .rolldate-wrapper ul{margin-top:68px}.rolldate-container .rolldate-wrapper li{height:36px}.rolldate-container .rolldate-dim{position:absolute;left:0;top:0;width:100%;height:68px;background:-webkit-gradient(linear,left bottom,left top,from(hsla(0,0%,100%,.4)),to(hsla(0,0%,100%,.8)));background:-webkit-linear-gradient(bottom,hsla(0,0%,100%,.4),hsla(0,0%,100%,.8));background:-o-linear-gradient(bottom,hsla(0,0%,100%,.4),hsla(0,0%,100%,.8));background:-webkit-gradient(linear, left bottom, left top, from(hsla(0, 0%, 100%, 0.4)), to(hsla(0, 0%, 100%, 0.8)));background:-webkit-linear-gradient(bottom, hsla(0, 0%, 100%, 0.4), hsla(0, 0%, 100%, 0.8));background:-o-linear-gradient(bottom, hsla(0, 0%, 100%, 0.4), hsla(0, 0%, 100%, 0.8));background:linear-gradient(0deg,hsla(0,0%,100%,.4),hsla(0,0%,100%,.8));pointer-events:none;-webkit-transform:translateZ(0);transform:translateZ(0);z-index:10}.rolldate-container .mask-top{border-bottom:1px solid #ebebeb}.rolldate-container .mask-bottom{top:auto;bottom:1px;border-top:1px solid #ebebeb}.rolldate-container .fadeIn{-webkit-animation-name:fadeIn;animation-name:fadeIn}.rolldate-container .fadeOut{-webkit-animation-name:fadeOut;animation-name:fadeOut}@-webkit-keyframes fadeIn{0%{bottom:-273px}to{bottom:0}}@keyframes fadeIn{0%{bottom:-273px}to{bottom:0}}@-webkit-keyframes fadeOut{0%{bottom:0}to{bottom:-273px;display:none}}@keyframes fadeOut{0%{bottom:0}to{bottom:-273px;display:none}}@media screen and (max-width:414px){.rolldate-container{font-size:18px}}@media screen and (max-width:320px){.rolldate-container{font-size:15px}}");"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var t,S=(function(t,i){t.exports=function(){function s(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}var h=function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,i){var e=[],o=!0,s=!1,n=void 0;try{for(var r,a=t[Symbol.iterator]();!(o=(r=a.next()).done)&&(e.push(r.value),!i||e.length!==i);o=!0);}catch(t){s=!0,n=t}finally{try{!o&&a.return&&a.return()}finally{if(s)throw n}}return e}(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")},e="undefined"!=typeof window,t=e&&navigator.userAgent.toLowerCase(),i=t&&/wechatdevtools/.test(t),o=t&&0<t.indexOf("android");function b(){return window.performance&&window.performance.now?window.performance.now()+window.performance.timing.navigationStart:+new Date}function l(t){for(var i=arguments.length,e=Array(1<i?i-1:0),o=1;o<i;o++)e[o-1]=arguments[o];for(var s=0;s<e.length;s++){var n=e[s];for(var r in n)t[r]=n[r]}return t}function c(t){return null==t}var n=e&&document.createElement("div").style,r=function(){if(!e)return!1;var t={webkit:"webkitTransform",Moz:"MozTransform",O:"OTransform",ms:"msTransform",standard:"transform"};for(var i in t)if(void 0!==n[t[i]])return i;return!1}();function a(t){return!1!==r&&("standard"===r?"transitionEnd"===t?"transitionend":t:r+t.charAt(0).toUpperCase()+t.substr(1))}function d(t,i,e,o){t.addEventListener(i,e,{passive:!1,capture:!!o})}function p(t,i,e,o){t.removeEventListener(i,e,{passive:!1,capture:!!o})}function m(t){for(var i=0,e=0;t;)i-=t.offsetLeft,e-=t.offsetTop,t=t.offsetParent;return{left:i,top:e}}r&&"standard"!==r&&r.toLowerCase();var u=a("transform"),f=a("transition"),v=e&&a("perspective")in n,g=e&&("ontouchstart"in window||i),w=!1!==u,y=e&&f in n,x={transform:u,transition:f,transitionTimingFunction:a("transitionTimingFunction"),transitionDuration:a("transitionDuration"),transitionDelay:a("transitionDelay"),transformOrigin:a("transformOrigin"),transitionEnd:a("transitionEnd")},T={touchstart:1,touchmove:1,touchend:1,mousedown:2,mousemove:2,mouseup:2};function S(t){if(t instanceof window.SVGElement){var i=t.getBoundingClientRect();return{top:i.top,left:i.left,width:i.width,height:i.height}}return{top:t.offsetTop,left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight}}function Y(t,i){for(var e in i)if(i[e].test(t[e]))return!0;return!1}function D(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"click",e=void 0;"mouseup"===t.type||"mousecancel"===t.type?e=t:"touchend"!==t.type&&"touchcancel"!==t.type||(e=t.changedTouches[0]);var o={};e&&(o.screenX=e.screenX||0,o.screenY=e.screenY||0,o.clientX=e.clientX||0,o.clientY=e.clientY||0);var s=void 0,n=!0,r=!0;if("undefined"!=typeof MouseEvent)try{s=new MouseEvent(i,l({bubbles:n,cancelable:r},o))}catch(t){a()}else a();function a(){(s=document.createEvent("Event")).initEvent(i,n,r),l(s,o)}s.forwardedTouchEvent=!0,s._constructed=!0,t.target.dispatchEvent(s)}var X={startX:0,startY:0,scrollX:!1,scrollY:!0,freeScroll:!1,directionLockThreshold:5,eventPassthrough:"",click:!1,tap:!1,bounce:!0,bounceTime:800,momentum:!0,momentumLimitTime:300,momentumLimitDistance:15,swipeTime:2500,swipeBounceTime:500,deceleration:.0015,flickLimitTime:200,flickLimitDistance:100,resizePolling:60,probeType:0,preventDefault:!0,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT|AUDIO)$/},HWCompositing:!0,useTransition:!0,useTransform:!0,bindToWrapper:!1,disableMouse:g,disableTouch:!g,observeDOM:!0,autoBlur:!0,wheel:!1,snap:!1,scrollbar:!1,pullDownRefresh:!1,pullUpLoad:!1,mouseWheel:!1,stopPropagation:!1,zoom:!1,infinity:!1,dblclick:!1},M={swipe:{style:"cubic-bezier(0.23, 1, 0.32, 1)",fn:function(t){return 1+--t*t*t*t*t}},swipeBounce:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(t){return t*(2-t)}},bounce:{style:"cubic-bezier(0.165, 0.84, 0.44, 1)",fn:function(t){return 1- --t*t*t*t}}};function k(t,i,e,o,s,n,r){var a=t-i,l=Math.abs(a)/e,h=r.deceleration,c=r.itemHeight,d=r.swipeBounceTime,p=r.wheel,m=r.swipeTime,u=p?4:15,f=t+l/h*(a<0?-1:1);return p&&c&&(f=Math.round(f/c)*c),f<o?(f=n?Math.max(o-n/4,o-n/u*l):o,m=d):s<f&&(f=n?Math.min(s+n/4,s+n/u*l):s,m=d),{destination:Math.round(f),duration:m}}function _(){}var E,L,O,I,P,H=e?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||function(t){return window.setTimeout(t,(t.interval||100/60)/2)}:_,W=e?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||function(t){window.clearTimeout(t)}:_;function z(t){console.error("[BScroll warn]: "+t)}function C(t,i){this.wrapper="string"==typeof t?document.querySelector(t):t,this.wrapper||z("Can not resolve the wrapper DOM."),this.scroller=this.wrapper.children[0],this.scroller||z("The wrapper need at least one child element to be scroller."),this.scrollerStyle=this.scroller.style,this._init(i)}return(E=C).prototype._init=function(t){this._handleOptions(t),this._events={},this.x=0,this.y=0,this.directionX=0,this.directionY=0,this.setScale(1),this._addDOMEvents(),this._initExtFeatures(),this._watchTransition(),this.options.observeDOM&&this._initDOMObserver(),this.options.autoBlur&&this._handleAutoBlur(),this.refresh(),this.options.snap||this.scrollTo(this.options.startX,this.options.startY),this.enable()},E.prototype.setScale=function(t){this.lastScale=c(this.scale)?t:this.scale,this.scale=t},E.prototype._handleOptions=function(t){this.options=l({},X,t),this.translateZ=this.options.HWCompositing&&v?" translateZ(0)":"",this.options.useTransition=this.options.useTransition&&y,this.options.useTransform=this.options.useTransform&&w,this.options.preventDefault=!this.options.eventPassthrough&&this.options.preventDefault,this.options.scrollX="horizontal"!==this.options.eventPassthrough&&this.options.scrollX,this.options.scrollY="vertical"!==this.options.eventPassthrough&&this.options.scrollY,this.options.freeScroll=this.options.freeScroll&&!this.options.eventPassthrough,this.options.directionLockThreshold=this.options.eventPassthrough?0:this.options.directionLockThreshold,!0===this.options.tap&&(this.options.tap="tap")},E.prototype._addDOMEvents=function(){var t=d;this._handleDOMEvents(t)},E.prototype._removeDOMEvents=function(){var t=p;this._handleDOMEvents(t)},E.prototype._handleDOMEvents=function(t){var i=this.options.bindToWrapper?this.wrapper:window;t(window,"orientationchange",this),t(window,"resize",this),this.options.click&&t(this.wrapper,"click",this,!0),this.options.disableMouse||(t(this.wrapper,"mousedown",this),t(i,"mousemove",this),t(i,"mousecancel",this),t(i,"mouseup",this)),g&&!this.options.disableTouch&&(t(this.wrapper,"touchstart",this),t(i,"touchmove",this),t(i,"touchcancel",this),t(i,"touchend",this)),t(this.scroller,x.transitionEnd,this)},E.prototype._initExtFeatures=function(){this.options.snap&&this._initSnap(),this.options.scrollbar&&this._initScrollbar(),this.options.pullUpLoad&&this._initPullUp(),this.options.pullDownRefresh&&this._initPullDown(),this.options.wheel&&this._initWheel(),this.options.mouseWheel&&this._initMouseWheel(),this.options.zoom&&this._initZoom(),this.options.infinity&&this._initInfinite()},E.prototype._watchTransition=function(){if("function"==typeof Object.defineProperty){var s=this,n=!1,t=this.options.useTransition?"isInTransition":"isAnimating";Object.defineProperty(this,t,{get:function(){return n},set:function(t){n=t;for(var i=s.scroller.children.length?s.scroller.children:[s.scroller],e=n&&!s.pulling?"none":"auto",o=0;o<i.length;o++)i[o].style.pointerEvents=e}})}},E.prototype._handleAutoBlur=function(){this.on("scrollStart",function(){var t=document.activeElement;!t||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName||t.blur()})},E.prototype._initDOMObserver=function(){var n=this;if("undefined"!=typeof MutationObserver){var r=void 0,t=new MutationObserver(function(t){if(!n._shouldNotRefresh()){for(var i=!1,e=!1,o=0;o<t.length;o++){var s=t[o];if("attributes"!==s.type){i=!0;break}if(s.target!==n.scroller){e=!0;break}}i?n.refresh():e&&(clearTimeout(r),r=setTimeout(function(){n._shouldNotRefresh()||n.refresh()},60))}});t.observe(this.scroller,{attributes:!0,childList:!0,subtree:!0}),this.on("destroy",function(){t.disconnect()})}else this._checkDOMUpdate()},E.prototype._shouldNotRefresh=function(){var t=this.x>this.minScrollX||this.x<this.maxScrollX||this.y>this.minScrollY||this.y<this.maxScrollY;return this.isInTransition||this.stopFromTransition||t},E.prototype._checkDOMUpdate=function(){var o=S(this.scroller),s=o.width,n=o.height;(function e(){var t=this;setTimeout(function(){(function(){if(!this.destroyed){var t=(o=S(this.scroller)).width,i=o.height;s===t&&n===i||this.refresh(),s=t,n=i,e.call(this)}}).call(t)},1e3)}).call(this)},E.prototype.handleEvent=function(t){switch(t.type){case"touchstart":case"mousedown":this._start(t),this.options.zoom&&t.touches&&1<t.touches.length&&this._zoomStart(t);break;case"touchmove":case"mousemove":this.options.zoom&&t.touches&&1<t.touches.length?this._zoom(t):this._move(t);break;case"touchend":case"mouseup":case"touchcancel":case"mousecancel":this.scaled?this._zoomEnd(t):this._end(t);break;case"orientationchange":case"resize":this._resize();break;case"transitionend":case"webkitTransitionEnd":case"oTransitionEnd":case"MSTransitionEnd":this._transitionEnd(t);break;case"click":this.enabled&&!t._constructed&&(Y(t.target,this.options.preventDefaultException)||(t.preventDefault(),t.stopPropagation()));break;case"wheel":case"DOMMouseScroll":case"mousewheel":this._onMouseWheel(t)}},E.prototype.refresh=function(){var t="static"===window.getComputedStyle(this.wrapper,null).position,i=S(this.wrapper);this.wrapperWidth=i.width,this.wrapperHeight=i.height;var e=S(this.scroller);this.scrollerWidth=Math.round(e.width*this.scale),this.scrollerHeight=Math.round(e.height*this.scale),this.relativeX=e.left,this.relativeY=e.top,t&&(this.relativeX-=i.left,this.relativeY-=i.top),this.minScrollX=0,this.minScrollY=0;var o=this.options.wheel;o?(this.items=this.scroller.children,this.options.itemHeight=this.itemHeight=this.items.length?this.scrollerHeight/this.items.length:0,void 0===this.selectedIndex&&(this.selectedIndex=o.selectedIndex||0),this.options.startY=-this.selectedIndex*this.itemHeight,this.maxScrollX=0,this.maxScrollY=-this.itemHeight*(this.items.length-1)):(this.maxScrollX=this.wrapperWidth-this.scrollerWidth,this.options.infinity||(this.maxScrollY=this.wrapperHeight-this.scrollerHeight),this.maxScrollX<0?(this.maxScrollX-=this.relativeX,this.minScrollX=-this.relativeX):1<this.scale&&(this.maxScrollX=this.maxScrollX/2-this.relativeX,this.minScrollX=this.maxScrollX),this.maxScrollY<0?(this.maxScrollY-=this.relativeY,this.minScrollY=-this.relativeY):1<this.scale&&(this.maxScrollY=this.maxScrollY/2-this.relativeY,this.minScrollY=this.maxScrollY)),this.hasHorizontalScroll=this.options.scrollX&&this.maxScrollX<this.minScrollX,this.hasVerticalScroll=this.options.scrollY&&this.maxScrollY<this.minScrollY,this.hasHorizontalScroll||(this.maxScrollX=this.minScrollX,this.scrollerWidth=this.wrapperWidth),this.hasVerticalScroll||(this.maxScrollY=this.minScrollY,this.scrollerHeight=this.wrapperHeight),this.endTime=0,this.directionX=0,this.directionY=0,this.wrapperOffset=m(this.wrapper),this.trigger("refresh"),this.scaled||this.resetPosition()},E.prototype.enable=function(){this.enabled=!0},E.prototype.disable=function(){this.enabled=!1},(L=C).prototype._start=function(t){var i=T[t.type];if((1===i||0===t.button)&&!(!this.enabled||this.destroyed||this.initiated&&this.initiated!==i)){this.initiated=i,this.options.preventDefault&&!Y(t.target,this.options.preventDefaultException)&&t.preventDefault(),this.options.stopPropagation&&t.stopPropagation(),this.moved=!1,this.distX=0,this.distY=0,this.directionX=0,this.directionY=0,this.movingDirectionX=0,this.movingDirectionY=0,this.directionLocked=0,this._transitionTime(),this.startTime=b(),this.options.wheel&&(this.target=t.target),this.stop();var e=t.touches?t.touches[0]:t;this.startX=this.x,this.startY=this.y,this.absStartX=this.x,this.absStartY=this.y,this.pointX=e.pageX,this.pointY=e.pageY,this.trigger("beforeScrollStart")}},L.prototype._move=function(t){if(this.enabled&&!this.destroyed&&T[t.type]===this.initiated){this.options.preventDefault&&t.preventDefault(),this.options.stopPropagation&&t.stopPropagation();var i=t.touches?t.touches[0]:t,e=i.pageX-this.pointX,o=i.pageY-this.pointY;this.pointX=i.pageX,this.pointY=i.pageY,this.distX+=e,this.distY+=o;var s=Math.abs(this.distX),n=Math.abs(this.distY),r=b();if(!(r-this.endTime>this.options.momentumLimitTime&&n<this.options.momentumLimitDistance&&s<this.options.momentumLimitDistance)){if(this.directionLocked||this.options.freeScroll||(s>n+this.options.directionLockThreshold?this.directionLocked="h":n>=s+this.options.directionLockThreshold?this.directionLocked="v":this.directionLocked="n"),"h"===this.directionLocked){if("vertical"===this.options.eventPassthrough)t.preventDefault();else if("horizontal"===this.options.eventPassthrough)return void(this.initiated=!1);o=0}else if("v"===this.directionLocked){if("horizontal"===this.options.eventPassthrough)t.preventDefault();else if("vertical"===this.options.eventPassthrough)return void(this.initiated=!1);e=0}e=this.hasHorizontalScroll?e:0,o=this.hasVerticalScroll?o:0,this.movingDirectionX=0<e?-1:e<0?1:0,this.movingDirectionY=0<o?-1:o<0?1:0;var a=this.x+e,l=this.y+o,h=!1,c=!1,d=!1,p=!1,m=this.options.bounce;!1!==m&&(h=void 0===m.top||m.top,c=void 0===m.bottom||m.bottom,d=void 0===m.left||m.left,p=void 0===m.right||m.right),(a>this.minScrollX||a<this.maxScrollX)&&(a=a>this.minScrollX&&d||a<this.maxScrollX&&p?this.x+e/3:a>this.minScrollX?this.minScrollX:this.maxScrollX),(l>this.minScrollY||l<this.maxScrollY)&&(l=l>this.minScrollY&&h||l<this.maxScrollY&&c?this.y+o/3:l>this.minScrollY?this.minScrollY:this.maxScrollY),this.moved||(this.moved=!0,this.trigger("scrollStart")),this._translate(a,l),r-this.startTime>this.options.momentumLimitTime&&(this.startTime=r,this.startX=this.x,this.startY=this.y,1===this.options.probeType&&this.trigger("scroll",{x:this.x,y:this.y})),1<this.options.probeType&&this.trigger("scroll",{x:this.x,y:this.y});var u=document.documentElement.scrollLeft||window.pageXOffset||document.body.scrollLeft,f=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,v=this.pointX-u,g=this.pointY-f;(v>document.documentElement.clientWidth-this.options.momentumLimitDistance||v<this.options.momentumLimitDistance||g<this.options.momentumLimitDistance||g>document.documentElement.clientHeight-this.options.momentumLimitDistance)&&this._end(t)}}},L.prototype._end=function(t){if(this.enabled&&!this.destroyed&&T[t.type]===this.initiated){this.initiated=!1,this.options.preventDefault&&!Y(t.target,this.options.preventDefaultException)&&t.preventDefault(),this.options.stopPropagation&&t.stopPropagation(),this.trigger("touchEnd",{x:this.x,y:this.y}),this.isInTransition=!1;var i=Math.round(this.x),e=Math.round(this.y),o=i-this.absStartX,s=e-this.absStartY;if(this.directionX=0<o?-1:o<0?1:0,this.directionY=0<s?-1:s<0?1:0,!this.options.pullDownRefresh||!this._checkPullDown())if(this._checkClick(t))this.trigger("scrollCancel");else if(!this.resetPosition(this.options.bounceTime,M.bounce)){this._translate(i,e),this.endTime=b();var n=this.endTime-this.startTime,r=Math.abs(i-this.startX),a=Math.abs(e-this.startY);if(this._events.flick&&n<this.options.flickLimitTime&&r<this.options.flickLimitDistance&&a<this.options.flickLimitDistance)this.trigger("flick");else{var l=0;if(this.options.momentum&&n<this.options.momentumLimitTime&&(a>this.options.momentumLimitDistance||r>this.options.momentumLimitDistance)){var h=!1,c=!1,d=!1,p=!1,m=this.options.bounce;!1!==m&&(h=void 0===m.top||m.top,c=void 0===m.bottom||m.bottom,d=void 0===m.left||m.left,p=void 0===m.right||m.right);var u=-1===this.directionX&&d||1===this.directionX&&p?this.wrapperWidth:0,f=-1===this.directionY&&h||1===this.directionY&&c?this.wrapperHeight:0,v=this.hasHorizontalScroll?k(this.x,this.startX,n,this.maxScrollX,this.minScrollX,u,this.options):{destination:i,duration:0},g=this.hasVerticalScroll?k(this.y,this.startY,n,this.maxScrollY,this.minScrollY,f,this.options):{destination:e,duration:0};i=v.destination,e=g.destination,l=Math.max(v.duration,g.duration),this.isInTransition=!0}else this.options.wheel&&(e=Math.round(e/this.itemHeight)*this.itemHeight,l=this.options.wheel.adjustTime||400);var w=M.swipe;if(this.options.snap){var y=this._nearestSnap(i,e);this.currentPage=y,l=this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(i-y.x),1e3),Math.min(Math.abs(e-y.y),1e3)),300),i=y.x,e=y.y,this.directionX=0,this.directionY=0,w=this.options.snap.easing||M.bounce}if(i!==this.x||e!==this.y)return(i>this.minScrollX||i<this.maxScrollX||e>this.minScrollY||e<this.maxScrollY)&&(w=M.swipeBounce),void this.scrollTo(i,e,l,w);this.options.wheel&&(this.selectedIndex=Math.round(Math.abs(this.y/this.itemHeight))),this.trigger("scrollEnd",{x:this.x,y:this.y})}}}},L.prototype._checkClick=function(t){var i,e,o,s,n,r=this.stopFromTransition&&!this.pulling;if(this.stopFromTransition=!1,this.moved)return!1;if(this.options.wheel){if(this.target&&this.target.classList.contains(this.options.wheel.wheelWrapperClass)){var a=Math.abs(Math.round(this.y/this.itemHeight)),l=Math.round((this.pointY+(s=this.wrapper,{left:-((n=s.getBoundingClientRect()).left+window.pageXOffset),top:-(n.top+window.pageYOffset)}).top-this.wrapperHeight/2)/this.itemHeight);this.target=this.items[a+l]}return this.scrollToElement(this.target,this.options.wheel.adjustTime||400,!0,!0,M.swipe),!0}if(r)return!1;var h=this.options.dblclick,c=!1;if(h&&this.lastClickTime){var d=h.delay,p=void 0===d?300:d;b()-this.lastClickTime<p&&(c=!0,D(t,"dblclick"))}return this.options.tap&&(i=t,e=this.options.tap,(o=document.createEvent("Event")).initEvent(e,!0,!0),o.pageX=i.pageX,o.pageY=i.pageY,i.target.dispatchEvent(o)),this.options.click&&!Y(t.target,this.options.preventDefaultException)&&D(t),this.lastClickTime=c?null:b(),!0},L.prototype._resize=function(){var t=this;this.enabled&&(o&&(this.wrapper.scrollTop=0),clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(function(){t.refresh()},this.options.resizePolling))},L.prototype._startProbe=function(){W(this.probeTimer),this.probeTimer=H(function t(){var i=e.getComputedPosition();e.trigger("scroll",i),e.isInTransition?e.probeTimer=H(t):e.trigger("scrollEnd",i)});var e=this},L.prototype._transitionTime=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0;if(this.scrollerStyle[x.transitionDuration]=t+"ms",this.options.wheel)for(var i=0;i<this.items.length;i++)this.items[i].style[x.transitionDuration]=t+"ms";if(this.indicators)for(var e=0;e<this.indicators.length;e++)this.indicators[e].transitionTime(t)},L.prototype._transitionTimingFunction=function(t){if(this.scrollerStyle[x.transitionTimingFunction]=t,this.options.wheel)for(var i=0;i<this.items.length;i++)this.items[i].style[x.transitionTimingFunction]=t;if(this.indicators)for(var e=0;e<this.indicators.length;e++)this.indicators[e].transitionTimingFunction(t)},L.prototype._transitionEnd=function(t){t.target===this.scroller&&this.isInTransition&&(this._transitionTime(),this.pulling&&1!==this.movingDirectionY||this.resetPosition(this.options.bounceTime,M.bounce)||(this.isInTransition=!1,3!==this.options.probeType&&this.trigger("scrollEnd",{x:this.x,y:this.y})))},L.prototype._translate=function(t,i,e){if(function(t){if(!t)throw new Error("[BScroll] Translate x or y is null or undefined.")}(!c(t)&&!c(i)),c(e)&&(e=this.scale),this.options.useTransform?this.scrollerStyle[x.transform]="translate("+t+"px,"+i+"px) scale("+e+")"+this.translateZ:(t=Math.round(t),i=Math.round(i),this.scrollerStyle.left=t+"px",this.scrollerStyle.top=i+"px"),this.options.wheel)for(var o=this.options.wheel.rotate,s=void 0===o?25:o,n=0;n<this.items.length;n++){var r=s*(i/this.itemHeight+n);this.items[n].style[x.transform]="rotateX("+r+"deg)"}if(this.x=t,this.y=i,this.setScale(e),this.indicators)for(var a=0;a<this.indicators.length;a++)this.indicators[a].updatePosition()},L.prototype._animate=function(r,a,l,h){var c=this,d=this.x,p=this.y,m=this.lastScale,u=this.scale,f=b(),v=f+l;this.isAnimating=!0,W(this.animateTimer),function t(){var i=b();if(v<=i)return c.isAnimating=!1,c._translate(r,a,u),c.trigger("scroll",{x:c.x,y:c.y}),void(c.pulling||c.resetPosition(c.options.bounceTime)||c.trigger("scrollEnd",{x:c.x,y:c.y}));var e=h(i=(i-f)/l),o=(r-d)*e+d,s=(a-p)*e+p,n=(u-m)*e+m;c._translate(o,s,n),c.isAnimating&&(c.animateTimer=H(t)),3===c.options.probeType&&c.trigger("scroll",{x:c.x,y:c.y})}()},L.prototype.scrollBy=function(t,i){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:M.bounce;t=this.x+t,i=this.y+i,this.scrollTo(t,i,e,o)},L.prototype.scrollTo=function(t,i){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:M.bounce;this.x===t&&this.y===i||(this.isInTransition=this.options.useTransition&&0<e&&(t!==this.x||i!==this.y),!e||this.options.useTransition?(this._transitionTimingFunction(o.style),this._transitionTime(e),this._translate(t,i),e&&3===this.options.probeType&&this._startProbe(),e||(this.trigger("scroll",{x:t,y:i}),this._reflow=document.body.offsetHeight,this.resetPosition(this.options.bounceTime,M.bounce)||this.trigger("scrollEnd",{x:t,y:i})),this.options.wheel&&(i>this.minScrollY?this.selectedIndex=0:i<this.maxScrollY?this.selectedIndex=this.items.length-1:this.selectedIndex=Math.round(Math.abs(i/this.itemHeight)))):this._animate(t,i,e,o.fn))},L.prototype.scrollToElement=function(t,i,e,o,s){if(t&&(t=t.nodeType?t:this.scroller.querySelector(t),!this.options.wheel||t.classList.contains(this.options.wheel.wheelItemClass))){var n=m(t);n.left-=this.wrapperOffset.left,n.top-=this.wrapperOffset.top,!0===e&&(e=Math.round(t.offsetWidth/2-this.wrapper.offsetWidth/2)),!0===o&&(o=Math.round(t.offsetHeight/2-this.wrapper.offsetHeight/2)),n.left-=e||0,n.top-=o||0,n.left=n.left>this.minScrollX?this.minScrollX:n.left<this.maxScrollX?this.maxScrollX:n.left,n.top=n.top>this.minScrollY?this.minScrollY:n.top<this.maxScrollY?this.maxScrollY:n.top,this.options.wheel&&(n.top=Math.round(n.top/this.itemHeight)*this.itemHeight),this.scrollTo(n.left,n.top,i,s)}},L.prototype.resetPosition=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:M.bounce,e=this.x,o=Math.round(e);!this.hasHorizontalScroll||o>this.minScrollX?e=this.minScrollX:o<this.maxScrollX&&(e=this.maxScrollX);var s=this.y,n=Math.round(s);return!this.hasVerticalScroll||n>this.minScrollY?s=this.minScrollY:n<this.maxScrollY&&(s=this.maxScrollY),(e!==this.x||s!==this.y)&&(this.scrollTo(e,s,t,i),!0)},L.prototype.getComputedPosition=function(){var t=window.getComputedStyle(this.scroller,null),i=void 0,e=void 0;return e=this.options.useTransform?(i=+((t=t[x.transform].split(")")[0].split(", "))[12]||t[4]),+(t[13]||t[5])):(i=+t.left.replace(/[^-\d.]/g,""),+t.top.replace(/[^-\d.]/g,"")),{x:i,y:e}},L.prototype.stop=function(){if(this.options.useTransition&&this.isInTransition){this.isInTransition=!1,W(this.probeTimer);var t=this.getComputedPosition();this._translate(t.x,t.y),this.options.wheel?this.target=this.items[Math.round(-t.y/this.itemHeight)]:this.trigger("scrollEnd",{x:this.x,y:this.y}),this.stopFromTransition=!0}else!this.options.useTransition&&this.isAnimating&&(this.isAnimating=!1,W(this.animateTimer),this.trigger("scrollEnd",{x:this.x,y:this.y}),this.stopFromTransition=!0)},L.prototype.destroy=function(){this.destroyed=!0,this.trigger("destroy"),this.options.useTransition?W(this.probeTimer):W(this.animateTimer),this._removeDOMEvents(),this._events={}},(O=C).prototype.on=function(t,i){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this;this._events[t]||(this._events[t]=[]),this._events[t].push([i,e])},O.prototype.once=function(t,i){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this;function o(){this.off(t,o),i.apply(e,arguments)}o.fn=i,this.on(t,o)},O.prototype.off=function(t,i){var e=this._events[t];if(e)for(var o=e.length;o--;)(e[o][0]===i||e[o][0]&&e[o][0].fn===i)&&s(e,o)},O.prototype.trigger=function(t){var i=this._events[t];if(i)for(var e=i.length,o=[].concat(function(t){if(Array.isArray(t)){for(var i=0,e=Array(t.length);i<t.length;i++)e[i]=t[i];return e}return Array.from(t)}(i)),s=0;s<e;s++){var n=o[s],r=h(n,2),a=r[0],l=r[1];a&&a.apply(l,[].slice.call(arguments,1))}},(I=C).prototype.wheelTo=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0;if(this.options.wheel){var i=-t*this.itemHeight;this.scrollTo(0,i)}},I.prototype.getSelectedIndex=function(){return this.options.wheel&&this.selectedIndex},I.prototype._initWheel=function(){var t=this.options.wheel;t.wheelWrapperClass||(t.wheelWrapperClass="wheel-scroll"),t.wheelItemClass||(t.wheelItemClass="wheel-item"),void 0===t.selectedIndex&&(t.selectedIndex=0,z("wheel option selectedIndex is required!"))},(P=C).prototype._initMouseWheel=function(){var t=this;this._handleMouseWheelEvent(d),this.on("destroy",function(){clearTimeout(t.mouseWheelTimer),clearTimeout(t.mouseWheelEndTimer),t._handleMouseWheelEvent(p)}),this.firstWheelOpreation=!0},P.prototype._handleMouseWheelEvent=function(t){t(this.wrapper,"wheel",this),t(this.wrapper,"mousewheel",this),t(this.wrapper,"DOMMouseScroll",this)},P.prototype._onMouseWheel=function(t){var i=this;if(this.enabled){t.preventDefault(),this.options.stopPropagation&&t.stopPropagation(),this.firstWheelOpreation&&this.trigger("scrollStart"),this.firstWheelOpreation=!1;var e=this.options.mouseWheel,o=e.speed,s=void 0===o?20:o,n=e.invert,r=void 0!==n&&n,a=e.easeTime,l=void 0===a?300:a;clearTimeout(this.mouseWheelTimer),this.mouseWheelTimer=setTimeout(function(){i.options.snap||l||i.trigger("scrollEnd",{x:i.x,y:i.y}),i.firstWheelOpreation=!0},400);var h=void 0,c=void 0;switch(!0){case"deltaX"in t:c=1===t.deltaMode?(h=-t.deltaX*s,-t.deltaY*s):(h=-t.deltaX,-t.deltaY);break;case"wheelDeltaX"in t:h=t.wheelDeltaX/120*s,c=t.wheelDeltaY/120*s;break;case"wheelDelta"in t:h=c=t.wheelDelta/120*s;break;case"detail"in t:h=c=-t.detail/3*s;break;default:return}var d=r?-1:1;h*=d,c*=d,this.hasVerticalScroll||(h=c,c=0);var p=void 0,m=void 0;if(this.options.snap)return p=this.currentPage.pageX,m=this.currentPage.pageY,0<h?p--:h<0&&p++,0<c?m--:c<0&&m++,void this._goToPage(p,m);p=this.x+Math.round(this.hasHorizontalScroll?h:0),m=this.y+Math.round(this.hasVerticalScroll?c:0),this.movingDirectionX=this.directionX=0<h?-1:h<0?1:0,this.movingDirectionY=this.directionY=0<c?-1:c<0?1:0,p>this.minScrollX?p=this.minScrollX:p<this.maxScrollX&&(p=this.maxScrollX),m>this.minScrollY?m=this.minScrollY:m<this.maxScrollY&&(m=this.maxScrollY);var u=this.y===m;this.scrollTo(p,m,l,M.swipe),this.trigger("scroll",{x:this.x,y:this.y}),clearTimeout(this.mouseWheelEndTimer),u&&(this.mouseWheelEndTimer=setTimeout(function(){i.trigger("scrollEnd",{x:i.x,y:i.y})},l))}},C.Version="1.14.1",C}()}(t={exports:{}},t.exports),t.exports);function i(t){if(t&&t.el){var i=this,e=i.$(t.el);if(e&&!e.bindRolldate&&(e.bindRolldate=1,i.extend(t),i.tap(e,function(){i.show()}),t.value)){"input"==e.nodeName.toLowerCase()?e.value=t.value:e.innerText=t.value;var o=t.value.replace(/-/g,"/").replace(/[^\d/:\s]/g,""),s=new Date(o);s&&"Invalid Date"!=s?e.bindDate=s:console.error("Invalid Date:"+o)}}}return i.prototype={constructor:i,baseData:function(){return{domId:{YYYY:"rolldate-year",MM:"rolldate-month",DD:"rolldate-day",hh:"rolldate-hour",mm:"rolldate-min",ss:"rolldate-sec"},opts:{el:"",format:"YYYY-MM-DD",beginYear:2e3,endYear:2100,init:null,moveEnd:null,confirm:null,cancel:null,minStep:1,trigger:"tap",lang:{title:"选择日期",cancel:"取消",confirm:"确认",year:"年",month:"月",day:"日",hour:"时",min:"分",sec:"秒"}}}},extend:function(t){var i=this.baseData().opts;for(var e in i)if(i[e]&&"[object Object]"==Object.prototype.toString.call(i[e]))for(var o in t[e])i[e][o]=null==t[e][o]?i[e][o]:t[e][o];else i[e]=t[e]||i[e];this.config=i},createUI:function(){for(var n=this,t=n.baseData(),r=n.config,a=t.domId,l=r.format.split(/-|\/|\s|:/g),i=l.length,e="",h=n.$(r.el).bindDate||new Date,c=r.lang,o=0;o<i;o++){var s=l[o],d=0;if(e+='<div id="'+a[s]+'"><ul class="wheel-scroll">',"YYYY"==s)for(var p=r.beginYear;p<=r.endYear;p++)e+='<li class="wheel-item '+(p==h.getFullYear()?"active":"")+'" data-index="'+d+'">'+p+c.year+"</li>",d++;else if("MM"==s)for(var m=1;m<=12;m++)e+='<li class="wheel-item '+(m==h.getMonth()+1?"active":"")+'" data-index="'+d+'">'+(m<10?"0"+m:m)+c.month+"</li>",d++;else if("DD"==s)for(var u=n.bissextile(h.getFullYear(),h.getMonth()+1),f=1;f<=u;f++)e+='<li class="wheel-item '+(f==h.getDate()?"active":"")+'" data-index="'+d+'">'+(f<10?"0"+f:f)+c.day+"</li>",d++;else if("hh"==s)for(var v=0;v<=23;v++)e+='<li class="wheel-item '+(v==h.getHours()?"active":"")+'" data-index="'+d+'">'+(v<10?"0"+v:v)+c.hour+"</li>",d++;else if("mm"==s)for(var g=0;g<=59;g+=r.minStep)e+='<li class="wheel-item '+(g==h.getMinutes()?"active":"")+'" data-index="'+d+'">'+(g<10?"0"+g:g)+c.min+"</li>",d++;else if("ss"==s)for(var w=0;w<=59;w++)e+='<li class="wheel-item '+(w==h.getSeconds()?"active":"")+'" data-index="'+d+'">'+(w<10?"0"+w:w)+c.sec+"</li>",d++;e+="</ul></div>"}var y='<div class="rolldate-mask"></div>\n            <div class="rolldate-panel fadeIn">\n                <header>\n                    <span class="rolldate-btn rolldate-cancel">'+c.cancel+"</span>\n                    "+c.title+'\n                    <span class="rolldate-btn rolldate-confirm">'+c.confirm+'</span>\n                </header>\n                <section class="rolldate-content">\n                    <div class="rolldate-dim mask-top"></div>\n                    <div class="rolldate-dim mask-bottom"></div>\n                    <div class="rolldate-wrapper">\n                        '+e+"\n                    </div>\n                </section>\n            </div>",b=document.createElement("div");b.className="rolldate-container"+(navigator.userAgent.match(/MicroMessenger/i)?" wx":""),b.innerHTML=y,document.body.appendChild(b),n.scroll={};for(var x=function(t){var i=a[l[t]];n.scroll[l[t]]=new S("#"+i,{wheel:{selectedIndex:0,wheelWrapperClass:"wheel-scroll",wheelItemClass:"wheel-item"},probeType:1});var o=n.scroll[l[t]],e=n.$("#"+i+" .active"),s=e?e.getAttribute("data-index"):Math.round(h.getMinutes()/r.minStep);o.wheelTo(s),o.on("scrollEnd",function(){if(r.moveEnd&&r.moveEnd.call(n,o),-1!=[a.YYYY,a.MM].indexOf(o.wrapper.id)&&n.scroll.DD){n.getSelected(n.scroll.DD);var t=n.bissextile(n.getSelected(n.scroll.YYYY),n.getSelected(n.scroll.MM)),i="";if(t!=n.$("#"+a.DD+" li",1).length){for(var e=1;e<=t;e++)i+='<li class="wheel-item">'+(e<10?"0"+e:e)+c.day+"</li>";n.$("#"+a.DD+" ul").innerHTML=i,n.scroll.DD.refresh()}}})},T=0;T<i;T++)x(T)},$:function(t,i){return"string"!=typeof t&&t.nodeType?t:i?document.querySelectorAll(t):document.querySelector(t)},tap:function(t,e){if("ontouchstart"in window&&"tap"==this.config.trigger){var o={};t.addEventListener("touchstart",function(t){var i=t.touches[0];o.startX=i.pageX,o.startY=i.pageY,o.sTime=+new Date}),t.addEventListener("touchend",function(t){var i=t.changedTouches[0];o.endX=i.pageX,o.endY=i.pageY,+new Date-o.sTime<300&&Math.abs(o.endX-o.startX)+Math.abs(o.endY-o.startY)<20&&(t.preventDefault(),e.call(this,t)),o={}})}else t.addEventListener("click",function(t){e.call(this,t)})},show:function(){var t=this,i=t.config,e=t.$(i.el);e.bindRolldate&&("input"==e.nodeName.toLowerCase()&&e.blur(),t.$(".rolldate-container")||i.init&&!1===i.init.call(t)||(t.createUI(),t.event()))},hide:function(t){var i=this.$(".rolldate-panel.fadeIn");i&&(i.className="rolldate-panel fadeOut",this.destroy(t))},event:function(){var a=this,t=a.$(".rolldate-mask"),i=a.$(".rolldate-cancel"),e=a.$(".rolldate-confirm");a.tap(t,function(){a.hide(1)}),a.tap(i,function(){a.hide(1)}),a.tap(e,function(){var t=a.config,i=a.$(t.el),e=t.format,o=new Date;for(var s in a.scroll){var n=a.getSelected(a.scroll[s]);e=e.replace(s,n),"YYYY"==s?o.setFullYear(n):"MM"==s?o.setMonth(n-1):"DD"==s?o.setDate(n):"hh"==s?o.setHours(n):"mm"==s?o.setMinutes(n):"ss"==s&&o.setSeconds(n)}if(t.confirm){var r=t.confirm.call(a,e);if(!1===r)return!1;r&&(e=r)}"input"==i.nodeName.toLowerCase()?i.value=e:i.innerText=e,a.hide(),i.bindDate=o})},bissextile:function(t,i){var e=void 0;return 1==i||3==i||5==i||7==i||8==i||10==i||12==i?e=31:4==i||6==i||11==i||9==i?e=30:2==i&&(e=t%4!=0||t%100==0&&t%400!=0?28:29),e},destroy:function(t){var i=this,e=i.config;for(var o in i.scroll)i.scroll[o].destroy();t&&e.cancel&&e.cancel.call(i),setTimeout(function(){var t=i.$(".rolldate-container");document.body.removeChild(t)},300)},getSelected:function(t){return this.$("#"+t.wrapper.id+" li",1)[t.getSelectedIndex()].innerText.replace(/\D/g,"")}},i.version="3.1.0",i});
View Code

 

o
粉丝 0
博文 500
码字总数 0
作品 0
私信 提问
加载中
请先登录后再评论。
移动端日期选择插件rolldate

rolldate为上一版jquery移动端时间插件的全新版本,目前保留了上一版的大部分功能,并且增加了回调函数,以及主题风格选取,最重要的是解决了上一版本的遗留问题,依赖jquery、滑动不够流畅、...

雾空
2018/08/19
0
0
来了!直击痛点的七大更新!APP上看报表就如同刷抖音

2019进入尾声,表哥表姐每天沉浸于开发移动端报表不可自拔,面对业务需求迎难而上,一路斩妖除魔,只为开发出一张张优质的报表。 表哥表姐日夜操劳,废寝忘食,似乎离业务部门的需求还是有一...

朕想上头条
2019/12/16
26
0
林俊杰--对的时间点 (多格式、功能强大的移动端日期时间选择插件)

很多时候都是需要在手机浏览器端使用时间选择,但是html5自带的时间选择样式不好看,而且不同的浏览器兼容性也不好,这个时候就需要一款很好的时间选择插件啦。最近在网上也找了很多相应的插...

码奴生来只知道前进~
03/31
0
0
Vue移动端flexible.js+MuseUi

因为公司有个项目需求,手机端的。之前就写了一个一样的项目,只不过是用原生的写的,心想刚写了个vue后台管理系统,何不也用vue写,所有就没有把之前的利用过来。那么问题来了,要让手机端自...

osc_l9rf3a4e
2019/04/10
4
0
日期选择库--react-dates

react-dates 如它的名字,就是个react的数据模组;提高代码的可视化编辑的移动友好的数据日期获取插件。 react-dates 是一个易于国际化使用,对移动端友好的 web 日期选择库。 Getting Star...

匿名
2017/02/21
870
0

没有更多内容

加载失败,请刷新页面

加载更多

智慧旅游背景下的景区新模式建设方案研讨

景区经营权管理方法实践、县域旅游基本模式以及智慧旅游一直是业内探究的关键。学术界对景区经营权出让探究比较多,如阎友兵探究了根据实物期权基础理论的景区经营权出让期限制度分配;郭淳凡...

osc_rezr8v4k
3分钟前
0
0
详解区块链是什么!KiBiEx加密货币交易所~

区块链是一个信息技术领域的术语。从本质上讲,它是一个共享数据库,存储于其中的数据或信息,具有“不可伪造”“全程留痕”“可以追溯”“公开透明”“集体维护”等特征。基于这些特征,区块...

osc_3361hjxk
4分钟前
0
0
详解区块链是什么!KiBiEx加密货币交易所~

区块链是一个信息技术领域的术语。从本质上讲,它是一个共享数据库,存储于其中的数据或信息,具有“不可伪造”“全程留痕”“可以追溯”“公开透明”“集体维护”等特征。基于这些特征,区块...

osc_3ytpwpyb
6分钟前
0
0
详解区块链是什么!KiBiEx加密货币交易所~

区块链是一个信息技术领域的术语。从本质上讲,它是一个共享数据库,存储于其中的数据或信息,具有“不可伪造”“全程留痕”“可以追溯”“公开透明”“集体维护”等特征。基于这些特征,区块...

osc_x4ot1joy
7分钟前
0
0
如何强制gradle重新下载依赖项? - How can I force gradle to redownload dependencies?

问题: 如何告诉gradle从存储库重新下载依赖项? 解决方案: 参考一: https://stackoom.com/question/uute/如何强制gradle重新下载依赖项 参考二: https://oldbug.net/q/uute/How-can-I-fo...

fyin1314
10分钟前
0
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部