ui-dtpicker

1.0.0 • Public • Published

ui-dtpicker

Datepicker web UI component

js-semistandard-style

Installation

$ npm install ui-dtpicker --save-dev

Usage

const Datepicker = require('ui-dtpicker');
const options = {
  // Set up options here (see below)
};
 
const someDatepicker = new Datepicker(options);
someContainerElement.appendChild(someDatepicker.element);
someDatepicker.getValue();

Options

Type: {Object}

tabindex

Type: {Integer}

The value of tabindex attribute to be set for the DOM element of the first button. Default: 1.

initialValue

Type: {Date}

Sets up the initial value of the element.

onValueChange

Type: {Function | Array<Function>}

Callback function(s) that will be called every time the value of the element changes.

When called, the function will be passed the following arguments:

  • {Date} val - New value of the element.

API

Properties

element

Type: {HTMLElement}

Returns reference to the DOM node created by the constructor.

lastTabindex

Type: {Integer}

Returns the last tabindex value used by the component.

Methods

setValue(val)

Sets the element's value.

Parameters:

  • {Date} valueData - The new component value.

Return: {undefined}

getValue()

Gets the current value of the component.

Return: {Date}

Package Sidebar

Install

npm i ui-dtpicker

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • agorokhov