🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

Duration Picker is a jQuery plugin used to create a years, months, days, hours, minutes, seconds duration picker using jQuery UI datepicker widget.

Time-Picker Duration-Picker

Documentation

jQuery UI Widget: Duration Picker

Screenshot

This widget aims to provide an interface from which users can easily set a duration in time. It allows a single value in seconds to be retrieved.

If there is an interest or a need I'll modify this widget to have more types of units and some more configuration options.

Getting Started

Include jQuery and jQuery UI in a HTML page, and add a div:

<body>     <div id="durationPicker"></div> </body>

Initialize the durationPicker:

$("#durationPicker").durationPicker()

API

Get raw seconds:

var seconds = $("#durationPicker").durationPicker("seconds");

Set raw seconds:

$("#durationPicker").durationPicker("seconds", 123);

Get values by unit:

$("#durationPicker").durationPicker("getUnitQty", "hours");

Set values by unit:

$("#durationPicker").durationPicker("setUnitQty", "hours", 2);

You May Also Like