forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pikaday.d.ts
89 lines (65 loc) · 1.81 KB
/
pikaday.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Type definitions for pikaday
// Project: https://github.com/dbushell/Pikaday
// Definitions by: Rudolph Gottesheim <http://midnight-design.at/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../moment/moment.d.ts" />
interface PikadayI18nConfig {
previousMonth: string;
nextMonth: string;
months: string[];
weekdays: string[];
weekdaysShort: string[];
}
interface PikadayOptions {
field?: HTMLElement;
format?: string;
trigger?: HTMLElement;
bound?: boolean;
position?: string;
reposition?: boolean;
container?: HTMLElement;
defaultDate?: Date;
setDefaultDate?: boolean;
firstDay?: number;
minDate?: Date;
maxDate?: Date;
disableWeekends?: boolean;
disableDayFn?: (date:Date) => boolean;
yearRange?: number[];
showWeekNumber?: boolean;
isRTL?: boolean;
i18n?: PikadayI18nConfig;
yearSuffix?: string;
showMonthAfterYear?: boolean;
numberOfMonths?: number;
mainCalendar?: string;
theme?: string;
onSelect?: (date:Date) => void;
onOpen?: () => void;
onClose?: () => void;
onDraw?: () => void;
}
declare class Pikaday {
el:HTMLElement;
constructor(options:PikadayOptions);
toString():string;
toString(format:string):string;
getDate():Date|void;
setDate(date:string|Date, triggerOnSelect?:boolean):void;
getMoment():moment.Moment;
setMoment(moment:any):void;
gotoDate(date:Date):void;
gotoToday():void;
gotoMonth(monthIndex:number):void;
gotoYear(year:number):void;
nextMonth():void;
prevMonth():void;
gogoYear(year:number):void;
setMinDate(date:Date):void;
setMaxDate(date:Date):void;
isVisible():boolean;
show():void;
hide():void;
adjustPosition():void;
destroy():void;
}