jQuery plugin which allow make interval from input
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
bower.json
interval-input.jquery.json
interval-input.js
package.json

README.md

intervalInput()

jQuery plugin which allow make interval from the input. Returns number of seconds calculated from the interval.

Usage

Base:

$('#selector').intervalInput();

Changed format:

$('#selector').intervalInput({
    format: 'h[-]i[-]s'
});

Event listener:

$('#selector').intervalInput();
$('#selector').on('intervalinputchange', function(e, data) {
    // do something on change event
});

See all examples.

API

Description of the API provided by the plugin.

Options

translations

Input tooltips texts.

Default:

{
    w: 'weeks',
    d: 'days',
    h: 'hours',
    i: 'minutes',
    s: 'seconds'
}

format

Format used to generate the inputs for interval.

Available options:

  • w - weeks
  • d - days
  • h - hours
  • i - minutes
  • s - seconds

Plugin allows to pass constant between options using braces ([, ]).

Syntax:

d[days]h[:]s

This example generate following structure: <input>days<input>:<input>

Default:

d[days]h[:]i[:]s

Methods

setEnabled(enabled)

  • enabled boolean

Set enabled or disabled plugin inputs.

refresh()

Recalcualte interval values.

Events

intervalinputchange

Event triggered on change value in the any input.