Skip to main content Skip to docs navigation

Display Functions

On this page
For the sake of the following documentation, assume there's a picker setup like this:
const picker = new tempusdominus
    .TempusDominus(document.getElementById('datetimepicker1'));

toggle

Shows or hides the widget

Emits

  • Namespace.events.hide - if the widget is hidden after the toggle call

  • Namespace.events.show - if the widget is show after the toggle call

  • Namespace.events.change - if the widget is opened for the first time and the input element is empty and options.useCurrent != false

show

Shows the widget

Emits

  • Namespace.events.show - if the widget was hidden before that call

  • Namespace.events.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

hide

Hides the widget

Emits

  • Namespace.events.hide - if the widget was visible before that call

paint(Unit | 'decade', DateTime, string[], HTMLElement)

Allows developers to add/remove classes from an element. During the grid generation code, this function is called.

It provides the unit that is being generated (i.e. displaying the main date view), the date time object being effected, the current set of css classes and the container element.

Check out the example paint plugin.