Update jquery.timepicker definitions, add tests

This commit is contained in:
Boris Yankov
2013-01-09 12:11:44 +02:00
parent 06bbfd9a24
commit b91ddee310
2 changed files with 47 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
// Type definitions for jQuery UI Timepicker 0.3.1
// Type definitions for jQuery UI Timepicker 0.3
// Project: http://fgelinas.com/code/timepicker/
// Definitions by: https://github.com/anwarjaved
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -22,7 +22,7 @@ interface TimePickerOptions {
// 'button' for trigger button, or 'both' for either (not yet implemented)
button?: string; // 'button' element that will trigger the timepicker
showAnim?: string; // Name of jQuery animation for popup
showOptions: any; // Options for enhanced animations
showOptions?: any; // Options for enhanced animations
appendText?: string; // Display text following the input box, e.g. showing the format
beforeShow: () => any; // Define a callback function executed before the timepicker is shown

View File

@@ -0,0 +1,45 @@
/// <reference path="../jquery/jquery-1.8.d.ts"/>
/// <reference path="jquery.timepicker-0.3.d.ts"/>
var beforeShowCallback, onSelectCallback, onCloseCallback, onHourShow, onMinuteShow;
$('#timepicker').timepicker({
timeSeparator: ':',
showLeadingZero: true,
showMinutesLeadingZero: true,
showPeriod: false,
showPeriodLabels: true,
periodSeparator: ' ',
altField: '#alternate_input',
defaultTime: '12:34',
showOn: 'focus',
button: null,
hourText: 'Hour',
minuteText: 'Minute',
amPmText: ['AM', 'PM'],
myPosition: 'left top',
atPosition: 'left bottom',
beforeShow: beforeShowCallback,
onSelect: onSelectCallback,
onClose: onCloseCallback,
onHourShow: onHourShow,
onMinuteShow: onMinuteShow,
hours: {
starts: 0,
ends: 23
},
minutes: {
starts: 0,
ends: 55,
interval: 5
},
rows: 4,
showHours: true,
showMinutes: true,
showCloseButton: false,
closeButtonText: 'Done',
showNowButton: false,
nowButtonText: 'Now',
showDeselectButton: false,
deselectButtonText: 'Deselect'
});