mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-12 22:36:10 +08:00
Update jquery.timepicker definitions, add tests
This commit is contained in:
@@ -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
|
||||
45
jquery.timepicker/jquery.timepicker-tests.ts
Normal file
45
jquery.timepicker/jquery.timepicker-tests.ts
Normal 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'
|
||||
});
|
||||
Reference in New Issue
Block a user