forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eonasdan-bootstrap-datetimepicker.d.ts
1246 lines (1052 loc) · 44.6 KB
/
eonasdan-bootstrap-datetimepicker.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for Bootstrap v3 Datepicker v4.17.37
// Project: http://eonasdan.github.io/bootstrap-datetimepicker
// Definitions by: Markus Peloso <https://github.com/ToastHawaii>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
/// <reference path="../moment/moment.d.ts"/>
declare namespace EonasdanBootstrapDatetimepicker {
type DateComparable = string | Date | moment.Moment;
type UseCurrent = "year" | "month" | "day" | "hour" | "minute";
interface Icons {
/**
* Default: "glyphicon glyphicon-chevron-right"
*/
time?: string;
/**
* Default: "glyphicon glyphicon-calendar"
*/
date?: string;
/**
* Default: "glyphicon glyphicon-chevron-up"
*/
up?: string;
/**
* Default: "glyphicon glyphicon-time"
*/
down?: string;
/**
* Default: "glyphicon glyphicon-screenshot"
*/
previous?: string;
/**
* Default: "glyphicon glyphicon-chevron-left"
*/
next?: string;
/**
* Default: "glyphicon glyphicon-chevron-down"
*/
today?: string;
/**
* Default: "glyphicon glyphicon-trash"
*/
clear?: string;
/**
* Default: "glyphicon glyphicon-remove"
*/
close?: string;
}
const enum DayOfWeek {
Sunday = 0,
Monday = 1,
Tuesday = 2,
Wednesday = 3,
Thursday = 4,
Friday = 5,
Saturday = 6
}
type ViewMode = "days" | "months" | "years" | "decades";
type ToolbarPlacement = "default" | "top" | "bottom";
interface WidgetPositioning {
horizontal?: "auto" | "left" | "right";
vertical?: "auto" | "top" | "bottom";
}
interface KeyBinds {
up?: (widget: JQuery | boolean) => any;
down?: (widget: JQuery | boolean) => any;
"control up"?: (widget: JQuery | boolean) => any;
"control down"?: (widget: JQuery | boolean) => any;
left?: (widget: JQuery | boolean) => any;
right?: (widget: JQuery | boolean) => any;
pageUp?: (widget: JQuery | boolean) => any;
pageDown?: (widget: JQuery | boolean) => any;
enter?: () => any;
escape?: () => any;
"control space"?: (widget: JQuery) => any;
t?: () => any;
delete?: () => any;
}
type FromTo = [moment.Moment, moment.Moment];
interface Tooltips {
/**
* Default: "Go to today"
*/
today?: string;
/**
* Default: "Clear selection"
*/
clear?: string;
/**
* Default: "Close the picker"
*/
close?: string;
/**
* Default: "Select Month"
*/
selectMonth?: string;
/**
* Default: "Previous Month"
*/
prevMonth?: string;
/**
* Default: "Next Month"
*/
nextMonth?: string;
/**
* Default: "Select Year"
*/
selectYear?: string;
/**
* Default: "Previous Year"
*/
prevYear?: string;
/**
* Default: "Next Year"
*/
nextYear?: string;
/**
* Default: "Select Decade"
*/
selectDecade?: string;
/**
* Default: "Previous Decade"
*/
prevDecade?: string;
/**
* Default: "Next Decade"
*/
nextDecade?: string;
/**
* Default: "Previous Century"
*/
prevCentury?: string;
/**
* Default: "Next Century"
*/
nextCentury?: string;
/**
* Default: "Pick Hour"
*/
pickHour?: string;
/**
* Default: "Increment Hour"
*/
incrementHour?: string;
/**
* Default: "Decrement Hour"
*/
decrementHour?: string;
/**
* Default: "Pick Minute"
*/
pickMinute?: string;
/**
* Default: "Increment Minute"
*/
incrementMinute?: string;
/**
* Default: "Decrement Minute"
*/
decrementMinute?: string;
/**
* Default: "Pick Second"
*/
pickSecond?: string;
/**
* Default: "Increment Second"
*/
incrementSecond?: string;
/**
* Default: "Decrement Second"
*/
decrementSecond?: string;
/**
* Default: "Toggle Period"
*/
togglePeriod?: string;
/**
* Default: "Select Time"
*/
selectTime?: string;
}
type ParseInputDateFunction = (inputDate: string) => moment.Moment;
interface OptionsBase {
/**
* Default: "Etc/UTC"
*/
timeZone?: string;
/**
* See momentjs' docs for valid formats. Format also dictates what components are shown, e.g. MM/dd/YYYY will not display the time picker.
* Default: false
*/
format?: string | boolean;
/**
* Changes the heading of the datepicker when in "days" view.
* Default: "MMMM YYYY"
*/
dayViewHeaderFormat?: string;
/**
* Allows for several input formats to be valid.
* Default: false
*/
extraFormats?: string[] | boolean;
/**
* Number of minutes the up/down arrow's will move the minutes value in the time picker.
* Default: 1
*/
stepping?: number;
/**
* Prevents date/time selections before this date.
* minDate will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected.
* Default: false
*/
minDate?: DateComparable | boolean;
/**
* Prevents date/time selections after this date.
* maxDate will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected.
* Default: false
*/
maxDate?: DateComparable | boolean;
/**
* On show, will set the picker to the current date/time
* Default: true
*/
useCurrent?: boolean | UseCurrent;
/**
* Using a Bootstraps collapse to switch between date/time pickers.
* Default: true
*/
collapse?: boolean;
/**
* See momentjs for valid locales.
* You must include moment-with-locales.js or a local js file.
* Default: moment.locale()
*/
locale?: string;
/**
* Sets the picker default date/time. Overrides useCurrent
* Default: false
*/
defaultDate?: DateComparable | boolean;
/**
* Change the default icons for the pickers functions
* Default: {
* time: "glyphicon glyphicon-time",
* date: "glyphicon glyphicon-calendar",
* up: "glyphicon glyphicon-chevron-up",
* down: "glyphicon glyphicon-chevron-down",
* previous: "glyphicon glyphicon-chevron-left",
* next: "glyphicon glyphicon-chevron-right",
* today: "glyphicon glyphicon-screenshot",
* clear: "glyphicon glyphicon-trash",
* close: "glyphicon glyphicon-remove"
* }
*/
icons?: Icons;
/**
* Defines if moment should use strict date parsing when considering a date to be valid
* Default: false
*/
useStrict?: boolean;
/**
* Shows the picker side by side when using the time and date together.
* Default: false
*/
sideBySide?: boolean;
/**
* Accepts: array of numbers from 0-6
* Disables the section of days of the week, e.g. weekends.
* Default: false
*/
daysOfWeekDisabled?: DayOfWeek[] | boolean;
/**
* Shows the week of the year to the left of first day of the week.
* Default: false
*/
calendarWeeks?: boolean;
/**
* The default view to display when the picker is shown.
* Note: To limit the picker to selecting, for instance the year and month, use format: MM/YYYY
* Default: "days"
*/
viewMode?: ViewMode;
/**
* Changes the placement of the icon toolbar.
* Default: "default"
*/
toolbarPlacement?: ToolbarPlacement;
/**
* Show the "Today" button in the icon toolbar.
* Clicking the "Today" button will set the calendar view and set the date to now.
* Default: false
*/
showTodayButton?: boolean;
/**
* Show the "Clear" button in the icon toolbar.
* Clicking the "Clear" button will set the calendar to null.
* Default: false
*/
showClear?: boolean;
/**
* Show the "Close" button in the icon toolbar.
* Clicking the "Close" button will call hide()
* Default: false
*/
showClose?: boolean;
/**
* Accepts: object with the all or one of the parameters above
* horizontal: 'auto', 'left', 'right'
* vertical: 'auto', 'top', 'bottom'
* Default: {
* horizontal: 'auto'
* vertical: 'auto'
* }
*/
widgetPositioning?: WidgetPositioning;
/**
* On picker show, places the widget at the identifier (string) or jQuery object if the element has css position: "relative"
* Default: null
*/
widgetParent?: string | JQuery;
/**
* Will cause the date picker to stay open after selecting a date if no time components are being used.
* Default: false
*/
keepOpen?: boolean;
/**
* Will display the picker inline without the need of a input field. This will also hide borders and shadows.
* Default: false
*/
inline?: boolean;
/**
* Default: ".datepickerinput"
*/
datepickerInput?: string;
/**
* Will cause the date picker to not revert or overwrite invalid dates.
* Default: false
*/
keepInvalid?: boolean;
/**
* Allows for custom events to fire on keyboard press.
* For example:
* keybinds:
* {
* up: (widget) => console.log(widget),
* "control up": (widget) => console.log(widget)
* }
* The widget parameter is false, if the datepicker is closed.
* Default: {
* up: function (widget) {
* if (widget.find(".datepicker").is(":visible")) {
* this.date(this.date().clone().subtract(7, "d"));
* } else {
* this.date(this.date().clone().add(1, "m"));
* }
* },
* down: function (widget) {
* if (!widget) {
* this.show();
* }
* else if (widget.find(".datepicker").is(":visible")) {
* this.date(this.date().clone().add(7, "d"));
* } else {
* this.date(this.date().clone().subtract(1, "m"));
* }
* },
* "control up": function (widget) {
* if (widget.find(".datepicker").is(":visible")) {
* this.date(this.date().clone().subtract(1, "y"));
* } else {
* this.date(this.date().clone().add(1, "h"));
* }
* },
* "control down": function (widget) {
* if (widget.find(".datepicker").is(":visible")) {
* this.date(this.date().clone().add(1, "y"));
* } else {
* this.date(this.date().clone().subtract(1, "h"));
* }
* },
* left: function (widget) {
* if (widget.find(".datepicker").is(":visible")) {
* this.date(this.date().clone().subtract(1, "d"));
* }
* },
* right: function (widget) {
* if (widget.find(".datepicker").is(":visible")) {
* this.date(this.date().clone().add(1, "d"));
* }
* },
* pageUp: function (widget) {
* if (widget.find(".datepicker").is(":visible")) {
* this.date(this.date().clone().subtract(1, "M"));
* }
* },
* pageDown: function (widget) {
* if (widget.find(".datepicker").is(":visible")) {
* this.date(this.date().clone().add(1, "M"));
* }
* },
* enter: function () {
* this.hide();
* },
* escape: function () {
* this.hide();
* },
* "control space": function (widget) {
* if (widget.find(".timepicker").is(":visible")) {
* widget.find(".btn[data-action="togglePeriod"]").click();
* }
* },
* t: function () {
* this.date(moment());
* },
* "delete": function () {
* this.clear();
* }
* }
*/
keyBinds?: KeyBinds;
/**
* Will cause the date picker to stay open after a blur event.
* Default: false
*/
debug?: boolean;
/**
* Allow date picker show event to fire even when the associated input element has the readonly="readonly" property.
* Default: false
*/
ignoreReadonly?: boolean;
/**
* Disables time selection between the given moments.
* For example:
* [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]]
* Default: false
*/
disabledTimeIntervals?: boolean | FromTo[];
/**
* If true, the picker will show on textbox focus and icon click when used in a button group
* Default: false
*/
allowInputToggle?: boolean;
/**
* If false, the textbox will not be given focus when the picker is shown
* Default: true
*/
focusOnShow?: boolean;
/**
* This will change the viewDate without changing or setting the selected date.
* Default: false
*/
viewDate?: DateComparable | boolean;
/**
* This will change the tooltips over each icon to a custom string
* Default: {
* today: "Go to today",
* clear: "Clear selection",
* close: "Close the picker",
* selectMonth: "Select Month",
* prevMonth: "Previous Month",
* nextMonth: "Next Month",
* selectYear: "Select Year",
* prevYear: "Previous Year",
* nextYear: "Next Year",
* selectDecade: "Select Decade",
* prevDecade: "Previous Decade",
* nextDecade: "Next Decade",
* prevCentury: "Previous Century",
* nextCentury: "Next Century"
* }
*/
tooltips?: Tooltips;
/**
* Allows custom input formatting.
* For example:
* The user can enter "yesterday" or "30 days ago".
*/
parseInputDate?: ParseInputDateFunction;
}
type IndexedDates = { [/** Dates as "YYYY-MM-DD keys */ date: string]: boolean };
type IndexedHours = { [/** Hours as "0" - "23" keys */ hour: string]: boolean };
interface GetOptions extends OptionsBase {
/**
* Disables selection of dates in the array, e.g. holidays
* IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true.
* For example:
* disabledDates = ["2010-10-10"]; -> disabledDated will be { "2010-01-01": true }
* Default: false
*/
disabledDates?: IndexedDates | boolean;
/**
* Enables selection of dates NOT in the array, e.g. holidays
* IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true.
* For example:
* enabledDates = ["2010-10-10"]; -> enabledDated will be { "2010-01-01": true }
* Default: false
*/
enabledDates?: IndexedDates | boolean;
/**
* Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days.
* IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true.
* For example:
* enabledHours = [0, 1]; -> enabledHours will be { "0": true, "1": true }
* Default: false
*/
enabledHours?: IndexedHours | boolean;
/**
* Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days.
* IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true.
* For example:
* disabledHours = [0, 1]; -> disabledHours will be { "0": true, "1": true }
* Default: false
*/
disabledHours?: IndexedHours | boolean;
}
interface SetOptions extends OptionsBase {
/**
* Disables selection of dates in the array, e.g. holidays
* IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true.
* For example:
* disabledDates = ["2010-10-10"]; -> disabledDated will be { "2010-01-01": true }
* Default: false
*/
disabledDates?: DateComparable[] | boolean;
/**
* Enables selection of dates NOT in the array, e.g. holidays
* IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true.
* For example:
* enabledDates = ["2010-10-10"]; -> enabledDated will be { "2010-01-01": true }
* Default: false
*/
enabledDates?: DateComparable[] | boolean;
/**
* Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days.
* IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true.
* For example:
* enabledHours = [0, 1]; -> enabledHours will be { "0": true, "1": true }
* Default: false
*/
enabledHours?: number[] | boolean;
/**
* Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days.
* IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true.
* For example:
* disabledHours = [0, 1]; -> disabledHours will be { "0": true, "1": true }
* Default: false
*/
disabledHours?: number[] | boolean;
}
interface Datetimepicker {
/**
* Destroys the widget and removes all attached event listeners.
*/
destroy(): void;
/**
* Shows or hides the widget.
* Emits:
* - dp.hide - if the widget is hidden after the toggle call
* - dp.show - if the widget is show after the toggle call
* - dp.change - if the widget is opened for the first time and the input element is empty and options.useCurrent != false
*/
toggle(): Datetimepicker;
/**
* Shows the widget.
* Emits:
* - dp.show - if the widget was hidden before that call
* - dp.change - if the widget is opened for the first time and the useCurrent is set to true or to a granularity value and the input element the component is attached to has an empty value
*/
show(): Datetimepicker;
/**
* Hides the widget.
* Emits:
* - dp.hide - if the widget was visible before that call
*/
hide(): Datetimepicker;
/**
* Disables the input element, the component is attached to, by adding a disabled="true" attribute to it. If the widget was visible before that call it is hidden.
* Emits:
* - dp.hide - if the widget was visible before that call
*/
disable(): Datetimepicker;
/**
* Enables the input element, the component is attached to, by removing disabled attribute from it.
*/
enable(): Datetimepicker;
/**
* Returns the component's model current date, a moment object or null if not set.
*/
date(): moment.Moment;
/**
* Takes string, Date, moment, null parameter and sets the components model current moment to it.
* Passing a null value unsets the components model current moment.
* Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration.
* Throws:
* - TypeError - in case the newDate cannot be parsed
*
* Emits:
* - dp.change - in case newDate is different from current moment
*/
date(date: DateComparable): Datetimepicker;
/**
* Clears the datepicker by setting the value to null.
*/
clear(): Datetimepicker;
/**
* For the moment this function will only prevent the picker from calling hide() on blur so that the picker can be inspected.
*/
debug(): Datetimepicker;
/**
* Returns the components current options object.
* Note that the changing the values of the returned object does not change the components actual configuration.
*/
options(): GetOptions
/**
* Takes an object variable with option key:value properties and configures the component. Use this to update multiple options on the component.
*/
options(options: SetOptions): Datetimepicker
//////////////////////////////////////////////////////////////////////////////////////
//// Below are the getters/setters for the properties of the 'options(): Options' ////
//////////////////////////////////////////////////////////////////////////////////////
/**
* Returns the component's options.timeZone.
*/
timeZone(): string;
timeZone(newZone: string): Datetimepicker;
/**
* Returns the options.disabledDates option.
* IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true.
* For example:
* disabledDates = ["2010-10-10"]; -> disabledDated will be { "2010-01-01": true }
*/
disabledDates(): IndexedDates | boolean;
/**
* Takes an array of values and disallows the user to select those days.
* Setting this takes precedence over options.minDate, options.maxDate configuration.
* Also calling this function removes the configuration of options.enabledDates if such exist.
* Note: These values are matched with Day granularity.
*/
disabledDates(dates: DateComparable[] | boolean): Datetimepicker;
/**
* Returns the options.enabledDates option.
* IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true.
* For example:
* enabledDates = ["2010-10-10"]; -> enabledDated will be { "2010-01-01": true }
*/
enabledDates(): IndexedDates | boolean;
/**
* Takes an array of values and allows the user to select only from those days.
* Setting this takes precedence over options.minDate, options.maxDate configuration.
* Also calling this function with boolean:false removes the configuration of options.disabledDates if such exist.
* Note: These values are matched with Day granularity.
*/
enabledDates(dates: DateComparable[] | boolean): Datetimepicker;
/**
* Returns a moment with the options.defaultDate option configuration or false if not set.
*/
defaultDate(): moment.Moment | boolean;
/**
* Will set the picker's inital date.
* If a boolean:false value is passed the options.defaultDate parameter is cleared.
* Throws:
* - TypeError - if the provided date doesn't pass validation, including disabledDates, enabledDates, minDate, maxDate, and daysOfWeekDisabled
* - TypeError - if the provided date cannot be parsed by momentjs
*/
defaultDate(dates: DateComparable | boolean): Datetimepicker;
/**
* Returns the options.useCurrent option configuration.
*/
useCurrent(): boolean | UseCurrent;
/**
* Takes a boolean or string.
* If a boolean true is passed and the components model moment is not set (either through setDate or through a valid value on the input element the component is attached to) then the first time the user opens the datetimepicker widget the value is initialized to the current moment of the action.
* If a false boolean is passed then no initialization happens on the input element.
* You can select the granularity on the initialized moment by passing one of the following strings ("year", "month", "day", "hour", "minute") in the variable.
* If for example you pass "day" to the useCurrent function and the input field is empty the first time the user opens the datetimepicker widget the input text will be initialized to the current datetime with day granularity (ie if currentTime = 2014-08-10 13:32:33 the input value will be initialized to 2014-08-10 00:00:00)
* Note: If the options.defaultDate is set or the input element the component is attached to has already a value that takes precedence and the functionality of useCurrent is not triggered!
*/
useCurrent(useCurrent: boolean | UseCurrent): Datetimepicker;
/**
* Returns the currently set moment of the options.minDate or false if not set.
*/
minDate(): moment.Moment | boolean;
/**
* Takes a parameter and disallows the user to select a moment that is before that moment.
* If a boolean:false value is passed the options.minDate parameter is cleared and there is no restriction to the miminum moment the user can select.
* Note: If the parameter is after the currently selected moment the currently selected moment changes to minDate parameter
* Throws:
* - TypeError - if the parameter cannot be parsed using the options.format and options.useStrict configuration settings
* - TypeError - if the parameter is after options.maxDate
*
* Emits:
* - dp.change - if the new minDate is after currently selected moment
* - dp.error - if the new minDate is after currently selected moment
*/
minDate(minDate: DateComparable | boolean): Datetimepicker;
/**
* Returns the currently set moment of the options.maxDate or false if not set.
*/
maxDate(): moment.Moment | boolean;
/**
* Takes a parameter and disallows the user to select a moment that is after that moment.
* If a boolean:false value is passed options.maxDate is cleared and there is no restriction to the maximum moment the user can select.
* Note: If the parameter is before the currently selected moment the currently selected moment changes to maxDate
* Throws:
* - TypeError - if the parameter cannot be parsed using the options.format and options.useStrict configuration settings
* - TypeError - if the parameter is before options.minDate
*
* Emits:
* - dp.change - if the new maxDate is after currently selected moment
* - dp.error - if the new maxDate is after currently selected moment
*/
maxDate(maxDate: DateComparable | boolean): Datetimepicker;
/**
* Returns the options.daysOfWeekDisabled configuration
* IMPORTANT! Throws exception if not set explicitly https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1459
*/
daysOfWeekDisabled(): DayOfWeek[];
/**
* Takes an [ Number:0 to 6 ] and disallow the user to select weekdays that exist in this array.
* This has lower priority over the options.minDate, options.maxDate, options.disabledDates and options.enabledDates configuration settings.
* Emits:
* - dp.change - if the currently selected moment falls in the values passed on the daysOfWeek parameter.
* - dp.error - if the currently selected moment falls in the values passed on the daysOfWeek parameter.
*/
daysOfWeekDisabled(daysOfWeek: DayOfWeek[]): Datetimepicker;
/**
* Returns the component's options.format.
*/
format(): string | boolean;
/**
* Takes a moment.js format string and sets the components options.format.
* This is used for displaying and also for parsing input strings either from the input element the component is attached to or the date() function.
* The parameter can also be a boolean:false in which case the format is set to the locale's L LT.
* Note: this is also used to determine if the TimePicker sub component will display the hours in 12 or 24 format. (if "a" or "h" exists in the passed string then a 12 hour mode is set)
*/
format(format: string | boolean): Datetimepicker;
/**
* Returns a boolean or array with the options.extraFormats option configuration.
*/
extraFormats(): string[] | boolean;
/**
* Takes an array of valid input moment format options, or boolean:false.
*/
extraFormats(formats: string[] | boolean): Datetimepicker;
/**
* Returns the currently set locale of the options.locale.
*/
locale(): string;
/**
* Takes a string of any valid moment locale e.g. de for German.
* Throws:
* - TypeError - if the locale is not loaded via a separate script or moment-with-locales
*/
locale(newLocale: string): Datetimepicker;
/**
* Returns a number with the options.stepping option configuration.
*/
stepping(): number;
/**
* This will be the amount the up/down arrows move the minute value with a time picker.
*/
stepping(step: number): Datetimepicker;
/**
* Returns a boolean of the options.sideBySide.
*/
sideBySide(): boolean;
/**
* If sideBySide is true and the time picker is used, both components will display side by side instead of collapsing.
*/
sideBySide(sideBySide: boolean): Datetimepicker;
/**
* Returns the options.collapse option configuration.
*/
collapse(): boolean;
/**
* If set to false the picker will display similar to sideBySide except vertical.
*/
collapse(collapse: boolean): Datetimepicker;
/**
* Returns options.icons.
*/
icons(): Icons;
/**
* Takes an Object of strings.
* Throws:
* - TypeError - if icons parameter is not an Object
*/
icons(icons: Icons): Datetimepicker;
/**
* Returns the options.useStrict
*/
useStrict(): boolean;
/**
* If useStrict is true, momentjs parsing rules will be stricter when determining if a date is valid or not.
*/
useStrict(useStrict: boolean): Datetimepicker;
/**
* Returns the options.widgetPositioning object.
*/
widgetPositioning(): WidgetPositioning;
/**
* WidgetPositioning defines where the dropdown with the widget will appear relative to the input element the component is attached to.
* "auto" is the default value for both horizontal and vertical keys and it tries to automatically place the dropdown in a position that is visible to the user.
* Usually you should not override those options unless you have a special need in your layout.
*/
widgetPositioning(positioningObject: WidgetPositioning): Datetimepicker;
/**
* Returns the options.viewMode.
*/
viewMode(): ViewMode;
/**
* Takes a string. Valid values are "days", "months", "years" and "decades"
* Throws:
* - TypeError - if newViewMode parameter is not an a string or if newViewMode is not a valid value
*/
viewMode(newViewMode: ViewMode): Datetimepicker;
/**
* Returns the current options.calendarWeeks option configuration.
*/
calendarWeeks(): boolean;
/**
* Set if the week numbers will appear to the left on the days view.
*/
calendarWeeks(calendarWeeks: boolean): Datetimepicker;
/**
* Returns the options.showClear option.
*/
showClear(): boolean;
/**
* Set if the clear date button will appear on the widget.
*/
showClear(showClear: boolean): Datetimepicker;
/**
* Returns the options.showTodayButton option.
*/
showTodayButton(): boolean;
/**
* Set if the Today button will appear on the widget.
*/
showTodayButton(showTodayButton: boolean): Datetimepicker;
/**
* Returns the options.toolbarplacement option.
*/
toolbarPlacement(): ToolbarPlacement;
/**
* Changes the placement of the toolbar where the today, clear, component switch icon are located.
* See valid values at DatetimepickerOptions.toolbarplacement
* Throws:
* - TypeError if the parameter is not a valid value
*/
toolbarPlacement(toolbarPlacement: ToolbarPlacement): Datetimepicker;
/**
* Returns the options.dayViewHeaderFormat option.
*/