Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

jqueryscript/bootstrap-duration-picker

 
 

Repository files navigation

Javascript library for selecting duration. Target input to which plugin is applied will contain duration in seconds.

Code Climatenpm versionBower version

Installation

Using Bower:

bower install bootstrap-duration-picker

Using NPM:

npm install bootstrap-duration-picker

Or simply copybootstrap-duration-picker.css andbootstrap-duration-picker.js files to your project.

Example

Bootstrap-Duration-Picker

Dependencies

  • jQuery
  • Bootstrap 5 & 4 (for styling only)

Usage

$('.duration-picker').durationPicker();// or$('.duration-picker').durationPicker({// optional object with translations (English is used by default)translations:{day:'dia',hour:'hora',minute:'minuto',second:'segundo',days:'dias',hours:'horas',minutes:'minutos',seconds:'segundos',},// defines whether to show seconds or notshowSeconds:false,// defines whether to show days or notshowDays:true,// callback function that triggers every time duration is changed//   value - duration in seconds//   isInitializing - bool valueonChanged:function(value,isInitializing){// isInitializing will be `true` when the plugin is initialized for the// first time or when it's re-initialized by calling `setValue` methodconsole.log(value,isInitializing);}});

Public methods

MethodExampleDescription
setValue$('#selector').data('durationPicker').setValue(0);Allows to reinitialize duration picker value after it's been created. Accepts new number of seconds
destroy$('#selector').data('durationPicker').destroy();Destroys the plugin, reverting any DOM changes made by the plugin

License

Please seeLICENSE for licensing details.

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript100.0%

[8]ページ先頭

©2009-2025 Movatter.jp