Fork me on GitHub

timepoint-selection

npm install timepoint-selection

Enhance input elements with easy key entry and validation for durations. Can input numbers directly or increment and decrement with up and down arrow keys. Rollover is automatically handled. Left and right arrow keys navigate through the input selecting the next important character for entry. Tabbing into an element automatically selects the first character in the input for easier entry.

selection(document.getElementById("ex1"));
selection(document.getElementById("ex2"), {
  'durationFormat': 'hh:mm:ss',
  'max': 3600 * 24
});
selection(document.getElementById("ex3"), {
  'durationFormat': 'hh:mm'
});
selection(document.getElementById("ex4"), {
  'durationFormat': 'hh:mm',
  'max': 3600 * 12
});