forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.datepicker.d.ts
57 lines (51 loc) · 2.08 KB
/
bootstrap.datepicker.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Type definitions for bootstrap.datepicker
// Project: https://github.com/eternicode/bootstrap-datepicker
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
/**
* All options that take a “Date” can handle a Date object; a String
* formatted according to the given format; or a timedelta relative
* to today, eg “-1d”, “+6m +1y”, etc, where valid units are “d” (day),
* “w” (week), “m” (month), and “y” (year).
*
* See online docs for more info:
* http://bootstrap-datepicker.readthedocs.org/en/release/options.html
*/
interface DatepickerOptions {
format?: string;
weekStart?: number;
startDate?: any;
endDate?: any;
autoclose?: boolean;
startView?: number;
todayBtn?: any;
todayHighlight?: boolean;
keyboardNavigation?: boolean;
language?: string;
beforeShowDay?: (date: any) => any;
calendarWeeks?: boolean;
clearBtn?: boolean;
daysOfWeekDisabled?: number[];
forceParse?: boolean;
inputs?: any[];
minViewMode?: any;
multidate?: any;
multidateSeparator?: string;
orientation?: string;
}
interface DatepickerEventObject extends JQueryEventObject {
date: Date;
format(format?: string): string;
}
interface JQuery {
datepicker(): JQuery;
datepicker(methodName: string): any;
datepicker(methodName: string, params: any): any;
datepicker(options: DatepickerOptions): JQuery;
off(events: "changeDate", selector?: string, handler?: (eventObject: DatepickerEventObject) => any): JQuery;
off(events: "changeDate", handler: (eventObject: DatepickerEventObject) => any): JQuery;
on(events: "changeDate", selector: string, data: any, handler?: (eventObject: DatepickerEventObject) => any): JQuery;
on(events: "changeDate", selector: string, handler: (eventObject: DatepickerEventObject) => any): JQuery;
on(events: 'changeDate', handler: (eventObject: DatepickerEventObject) => any): JQuery;
}