source: admin-center/trunk/fuentes/admin-center.install/usr/share/admin-center/lib/bower_components/eonasdan-bootstrap-datetimepicker/docs/Functions.md @ 6782

Last change on this file since 6782 was 6782, checked in by kbut, 20 months ago

add moment and datetimepicker bootstrap plugin

File size: 1.8 KB
Line 
1## Functions
2
3<div class="alert alert-info">
4    <strong>Note</strong>
5    All functions are accessed via the <code>data</code> attribute e.g. <code>$('#datetimepicker').data("DateTimePicker").FUNCTION()</code>
6</div>
7
8###destroy()
9
10Destroys the widget and removes all attached event listeners
11
12----------------------
13
14### toggle()
15
16Shows or hides the widget
17
18#### Emits
19
20* `dp.hide` - if the widget is hidden after the toggle call
21
22* `dp.show` - if the widget is show after the toggle call
23
24* `dp.change` - if the widget is opened for the first time and the input element is empty and `options.useCurrent != false`
25
26----------------------
27
28### show()
29
30Shows the widget
31
32#### Emits
33
34* `dp.show` - if the widget was hidden before that call
35
36* `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
37
38----------------------
39
40### hide()
41
42Hides the widget
43
44#### Emits
45
46* `dp.hide` - if the widget was visible before that call
47
48----------------------
49
50### disable()
51
52Disables 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.
53
54#### Emits
55
56* `dp.hide` - if the widget was visible before that call
57
58----------------------
59
60### enable()
61
62Enables the input element, the component is attached to, by removing `disabled` attribute from it.
63
64----------------------
65
66### clear()
67
68Clears the datepicker by setting the value to `null`
69
70### viewDate
71
72<small>4.14.30</small> Issue #872
73
74#### viewDate()
75
76Returns a `moment` variable with the currently set `options.viewDate` option.
77
78#### viewDate(viewDate)
79
80Takes a `string, moment or Date` value.
81
82This will change the `viewDate` without changing or setting the selected date.
Note: See TracBrowser for help on using the repository browser.