commit
5ebb54b0e3
3
README
3
README
|
@ -1,5 +1,8 @@
|
||||||
jQuery Timepicker Addon
|
jQuery Timepicker Addon
|
||||||
|
=======================
|
||||||
|
|
||||||
|
Use
|
||||||
|
---
|
||||||
-To use this plugin you must include jQuery and jQuery UI with datepicker and slider
|
-To use this plugin you must include jQuery and jQuery UI with datepicker and slider
|
||||||
-Include timepicker-addon script
|
-Include timepicker-addon script
|
||||||
-now use timepicker with $('#selector').datetimepicker() or $('#selector').timepicker()
|
-now use timepicker with $('#selector').datetimepicker() or $('#selector').timepicker()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
|
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
|
||||||
.ui-timepicker-div dl { text-align: left; }
|
.ui-timepicker-div dl { text-align: left; }
|
||||||
.ui-timepicker-div dl dt { height: 25px; }
|
.ui-timepicker-div dl dt { height: 25px; }
|
||||||
.ui-timepicker-div dl dd { margin: -25px 0 10px 65px; }
|
.ui-timepicker-div dl dd { margin: -25px 10px 10px 65px; }
|
||||||
.ui-timepicker-div td { font-size: 90%; }
|
.ui-timepicker-div td { font-size: 90%; }
|
||||||
|
|
12
jquery-ui-timepicker-addon.js
vendored
12
jquery-ui-timepicker-addon.js
vendored
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* jQuery timepicker addon
|
* jQuery timepicker addon
|
||||||
* By: Trent Richardson [http://trentrichardson.com]
|
* By: Trent Richardson [http://trentrichardson.com]
|
||||||
* Version 0.9.4
|
* Version 0.9.5-dev
|
||||||
* Last Modified: 05/12/2011
|
* Last Modified: 05/12/2011
|
||||||
*
|
*
|
||||||
* Copyright 2011 Trent Richardson
|
* Copyright 2011 Trent Richardson
|
||||||
|
@ -501,7 +501,7 @@ $.extend(Timepicker.prototype, {
|
||||||
//Emulate datepicker onSelect behavior. Call on slidestop.
|
//Emulate datepicker onSelect behavior. Call on slidestop.
|
||||||
var onSelectDelegate = function() {
|
var onSelectDelegate = function() {
|
||||||
tp_inst._onSelectHandler();
|
tp_inst._onSelectHandler();
|
||||||
}
|
};
|
||||||
this.hour_slider.bind('slidestop',onSelectDelegate);
|
this.hour_slider.bind('slidestop',onSelectDelegate);
|
||||||
this.minute_slider.bind('slidestop',onSelectDelegate);
|
this.minute_slider.bind('slidestop',onSelectDelegate);
|
||||||
this.second_slider.bind('slidestop',onSelectDelegate);
|
this.second_slider.bind('slidestop',onSelectDelegate);
|
||||||
|
@ -601,7 +601,7 @@ $.extend(Timepicker.prototype, {
|
||||||
var hour = (this.hour_slider) ? this.hour_slider.slider('value') : false,
|
var hour = (this.hour_slider) ? this.hour_slider.slider('value') : false,
|
||||||
minute = (this.minute_slider) ? this.minute_slider.slider('value') : false,
|
minute = (this.minute_slider) ? this.minute_slider.slider('value') : false,
|
||||||
second = (this.second_slider) ? this.second_slider.slider('value') : false,
|
second = (this.second_slider) ? this.second_slider.slider('value') : false,
|
||||||
timezone = (this.timezone_select) ? this.timezone_select.val() : false
|
timezone = (this.timezone_select) ? this.timezone_select.val() : false;
|
||||||
|
|
||||||
if (hour !== false) hour = parseInt(hour,10);
|
if (hour !== false) hour = parseInt(hour,10);
|
||||||
if (minute !== false) minute = parseInt(minute,10);
|
if (minute !== false) minute = parseInt(minute,10);
|
||||||
|
@ -660,6 +660,8 @@ $.extend(Timepicker.prototype, {
|
||||||
.replace(/ss/g, ((time.second < 10) ? '0' : '') + time.second)
|
.replace(/ss/g, ((time.second < 10) ? '0' : '') + time.second)
|
||||||
.replace(/s/g, time.second)
|
.replace(/s/g, time.second)
|
||||||
.replace(/TT/g, time.ampm.toUpperCase())
|
.replace(/TT/g, time.ampm.toUpperCase())
|
||||||
|
.replace(/Tt/g, time.ampm.toUpperCase())
|
||||||
|
.replace(/tT/g, time.ampm.toLowerCase())
|
||||||
.replace(/tt/g, time.ampm.toLowerCase())
|
.replace(/tt/g, time.ampm.toLowerCase())
|
||||||
.replace(/T/g, time.ampm.charAt(0).toUpperCase())
|
.replace(/T/g, time.ampm.charAt(0).toUpperCase())
|
||||||
.replace(/t/g, time.ampm.charAt(0).toLowerCase())
|
.replace(/t/g, time.ampm.charAt(0).toLowerCase())
|
||||||
|
@ -810,6 +812,8 @@ $.datepicker._doKeyPress = function(event) {
|
||||||
datetimeChars = tp_inst._defaults.timeFormat.toString()
|
datetimeChars = tp_inst._defaults.timeFormat.toString()
|
||||||
.replace(/[hms]/g, '')
|
.replace(/[hms]/g, '')
|
||||||
.replace(/TT/g, ampm ? 'APM' : '')
|
.replace(/TT/g, ampm ? 'APM' : '')
|
||||||
|
.replace(/Tt/g, ampm ? 'AaPpMm' : '')
|
||||||
|
.replace(/tT/g, ampm ? 'AaPpMm' : '')
|
||||||
.replace(/T/g, ampm ? 'AP' : '')
|
.replace(/T/g, ampm ? 'AP' : '')
|
||||||
.replace(/tt/g, ampm ? 'apm' : '')
|
.replace(/tt/g, ampm ? 'apm' : '')
|
||||||
.replace(/t/g, ampm ? 'ap' : '') +
|
.replace(/t/g, ampm ? 'ap' : '') +
|
||||||
|
@ -958,7 +962,7 @@ $.datepicker._getDateDatepicker = function(target, noDefault) {
|
||||||
if (tp_inst) {
|
if (tp_inst) {
|
||||||
this._setDateFromField(inst, noDefault);
|
this._setDateFromField(inst, noDefault);
|
||||||
var date = this._getDate(inst);
|
var date = this._getDate(inst);
|
||||||
if (date && tp_inst._parseTime($(target).val(), true)) date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second);
|
if (date && tp_inst._parseTime($(target).val(), tp_inst.timeOnly)) date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second);
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
return this._base_getDateDatepicker(target, noDefault);
|
return this._base_getDateDatepicker(target, noDefault);
|
||||||
|
|
15
localization/jquery-ui-timepicker-cs.js
vendored
Normal file
15
localization/jquery-ui-timepicker-cs.js
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/* Czech translation for the jQuery Timepicker Addon */
|
||||||
|
/* Written by Ondřej Vodáček */
|
||||||
|
$.timepicker.regional['cs'] = {
|
||||||
|
timeOnlyTitle: 'Vyberte čas',
|
||||||
|
timeText: 'Čas',
|
||||||
|
hourText: 'Hodiny',
|
||||||
|
minuteText: 'Minuty',
|
||||||
|
secondText: 'Vteřiny',
|
||||||
|
timezoneText: 'Časové pásmo',
|
||||||
|
currentText: 'Nyní',
|
||||||
|
closeText: 'Zavřít',
|
||||||
|
timeFormat: 'h:m',
|
||||||
|
ampm: false
|
||||||
|
};
|
||||||
|
$.timepicker.setDefaults($.timepicker.regional['cs']);
|
15
localization/jquery-ui-timepicker-de.js
vendored
Normal file
15
localization/jquery-ui-timepicker-de.js
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/* German translation for the jQuery Timepicker Addon */
|
||||||
|
/* Written by Marvin */
|
||||||
|
$.timepicker.regional['de'] = {
|
||||||
|
timeOnlyTitle: 'Zeit Wählen',
|
||||||
|
timeText: 'Zeit',
|
||||||
|
hourText: 'Stunde',
|
||||||
|
minuteText: 'Minute',
|
||||||
|
secondText: 'Sekunde',
|
||||||
|
timezoneText: 'Zeitzone',
|
||||||
|
currentText: 'Jetzt',
|
||||||
|
closeText: 'Fertig',
|
||||||
|
timeFormat: 'hh:mm tt',
|
||||||
|
ampm: false
|
||||||
|
};
|
||||||
|
$.timepicker.setDefaults($.timepicker.regional['de']);
|
15
localization/jquery-ui-timepicker-fr.js
vendored
Normal file
15
localization/jquery-ui-timepicker-fr.js
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/* Czech translation for the jQuery Timepicker Addon */
|
||||||
|
/* Written by Thomas Lété */
|
||||||
|
$.timepicker.regional['fr'] = {
|
||||||
|
timeOnlyTitle: 'Choisir une heure',
|
||||||
|
timeText: 'Heure',
|
||||||
|
hourText: 'Heures',
|
||||||
|
minuteText: 'Minutes',
|
||||||
|
secondText: 'Secondes',
|
||||||
|
timezoneText: 'Fuseau horaire',
|
||||||
|
currentText: 'Maintenant',
|
||||||
|
closeText: 'Terminé'
|
||||||
|
timeFormat: 'h:m',
|
||||||
|
ampm: false
|
||||||
|
};
|
||||||
|
$.timepicker.setDefaults($.timepicker.regional['fr']);
|
15
localization/jquery-ui-timepicker-hu.js
vendored
Normal file
15
localization/jquery-ui-timepicker-hu.js
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/* Hungarian translation for the jQuery Timepicker Addon */
|
||||||
|
/* Written by Vas Gábor */
|
||||||
|
$.timepicker.regional['hu'] = {
|
||||||
|
currentText: 'Most',
|
||||||
|
closeText: 'Kész',
|
||||||
|
ampm: false,
|
||||||
|
timeFormat: 'hh:mm tt',
|
||||||
|
timeOnlyTitle: 'Válasszon időpontot',
|
||||||
|
timeText: 'Idő',
|
||||||
|
hourText: 'Óra',
|
||||||
|
minuteText: 'Perc',
|
||||||
|
secondText: 'Másodperc',
|
||||||
|
timezoneText: 'Időzóna'
|
||||||
|
};
|
||||||
|
$.timepicker.setDefaults($.timepicker.regional['hu']);
|
15
localization/jquery-ui-timepicker-nl.js
vendored
Normal file
15
localization/jquery-ui-timepicker-nl.js
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/* Dutch translation for the jQuery Timepicker Addon */
|
||||||
|
/* Written by Martijn van der Lee */
|
||||||
|
$.timepicker.regional['nl'] = {
|
||||||
|
timeOnlyTitle: 'Tijdstip',
|
||||||
|
timeText: 'Tijd',
|
||||||
|
hourText: 'Uur',
|
||||||
|
minuteText: 'Minuut',
|
||||||
|
secondText: 'Seconde',
|
||||||
|
timezoneText: 'Tijdzone',
|
||||||
|
currentText: 'Vandaag',
|
||||||
|
closeText: 'Sluiten',
|
||||||
|
timeFormat: 'hh:mm tt',
|
||||||
|
ampm: false
|
||||||
|
};
|
||||||
|
$.timepicker.setDefaults($.timepicker.regional['nl']);
|
15
localization/jquery-ui-timepicker-ru.js
vendored
Normal file
15
localization/jquery-ui-timepicker-ru.js
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/* Russian translation for the jQuery Timepicker Addon */
|
||||||
|
/* Written by Trent Richardson */
|
||||||
|
$.timepicker.regional['ru'] = {
|
||||||
|
timeOnlyTitle: 'Выберите время',
|
||||||
|
timeText: 'Время',
|
||||||
|
hourText: 'Часы',
|
||||||
|
minuteText: 'Минуты',
|
||||||
|
secondText: 'Секунды',
|
||||||
|
timezoneText: 'Время зоны',
|
||||||
|
currentText: 'Теперь',
|
||||||
|
closeText: 'Закрыть',
|
||||||
|
timeFormat: 'hh:mm tt',
|
||||||
|
ampm: false
|
||||||
|
};
|
||||||
|
$.timepicker.setDefaults($.timepicker.regional['ru']);
|
Loading…
Reference in a new issue