/* * jQuery Mobile Framework : plugin to provide a date and time picker. * Copyright (c) JTSage * CC 3.0 Attribution. May be relicensed without permission/notification. * https://github.com/jtsage/jquery-mobile-datebox */ /* FLIPBOX Mode */ (function($) { $.extend( $.mobile.datebox.prototype.options, { themeDateHigh: 'b', themeDatePick: 'b', themeDate: 'a', useSetButton: true, validHours: false, flen: {'y': 15, 'm':12, 'd':20, 'h':12, 'i':15, 'a':3} }); $.extend( $.mobile.datebox.prototype, { '_fbox_pos': function () { var w = this, ech = null, top = null, par = this.d.intHTML.find('.ui-datebox-flipcontent').innerHeight(), tot = null; w.d.intHTML.find('.ui-datebox-flipcenter').each(function() { ech = $(this); top = ech.innerHeight(); ech.css('top', ((par/2)-(top/2)-3)*-1); }); w.d.intHTML.find('ul').each(function () { ech = $(this); par = ech.parent().innerHeight(); top = ech.find('li').first(); tot = ech.find('li').size() * top.outerHeight(); fixer = ech.find('li').last().offset().top - ech.find('li').first().offset().top; pos1 = (((tot/2)-(par/2)+(top.outerHeight()/2))*-1); if ( fixer > 0 ) { pos1 = ((((fixer-par) / 2) + top.outerHeight()) * -1) } top.css('marginTop', pos1); }); } }); $.extend( $.mobile.datebox.prototype._build, { 'timeflipbox': function() { this._build.flipbox.apply(this); }, 'flipbox': function () { var w = this, o = this.options, i, y, hRow, tmp, testDate, iDate = (w.d.input.val() === "") ? w._startOffset(w._makeDate(w.d.input.val())) : w._makeDate(w.d.input.val()), uid = 'ui-datebox-', flipBase = $("
"), ctrl = $("