Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
jquery-clock-timepicker
Advanced tools
A free jQuery Plug-in to select the time with a clock inspired by the Android time picker. This plugin works on Desktop and Mobile phones.
A free jQuery Plug-in to select the time with a clock inspired by the Android time picker. This plugin works on Desktop and Mobile phones.
Note: You need the regular version of jQuery as the slim version does not include effects, which this library requires.
Install from NPM as jquery-clock-timepicker
.
npm install jquery-clock-timepicker
$('.your-time-field').clockTimePicker(options);
Include the file jquery-clock-timepicker.min.js
in your page. There is no need of a CSS file.
The Plug-in is customizable through the optional options
object passed to the jQuery method, i.e.
$('.your-time-field').clockTimePicker({
duration: true,
durationNegative: true,
precision: 5,
i18n: {
cancelButton: 'Abbrechen'
},
onAdjust: function(newVal, oldVal) {
//...
}
});
It is also possible to configure the ClockTimePicker element by using data attributes of the DOM element, i.e.
<input class="time" type="text" data-precision="5" data-minimum="10:00" data-maximum="20:00" />
You can combine the configuration by JavaScript and by the DOM data attributes. For example, you can use the JavaScript configuration to make a standard configuration for all your ClockTimePicker elements on the site and use the DOM data attributes to change configuration for individual elements. The data attributes have precedence over the JavaScript settings.
If you want to set new options at runtime (after an input element already has been intialized), just call the function again with all desired options.
If you want to dispose/destroy an initialized clock time picker element, please use the following code:
$('.your-time-field').clockTimePicker('dispose');
If you want to change the value programmatically at runtime on an already initialized clock time picker element, use the following code:
$('.your-time-field').clockTimePicker('value', '08:00');
Use the following code to show or hide a clock time picker programmatically:
$('.your-time-field').clockTimePicker('show');
$('.your-time-field').clockTimePicker('hide');
afternoonHoursInOuterCircle
Set this option to true to display the afternoon hours in the outer circle instead of the inner circle.
default: false
alwaysSelectHoursFirst
By default, if you click on the minutes part of your input field, the popup is opened to directly select the minutes. If you set this option to true, popup is always opened to select hours first before selecting the minutes.
default: false
autosize
Set this to true, if the width of the input field should be automatically adjusted to its content.
default: false
colors.buttonTextColor
The text color of the buttons display on the mobile phone.
default: '#0797FF'
colors.clockFaceColor
The color of the clock face.
default: '#EEEEEE'
colors.clockInnerCircleTextColor
The text color of the numbers displayed in the inner circle.
default: '#888888'
colors.clockInnerCircleUnselectableTextColor
The text color of the unselectable numbers displayed in the inner circle. (only used in combination with minimum
and maximum
option)
default: '#888888'
colors.clockOuterCircleTextColor
The text color of the numbers displayed in the outer circle.
default: '#000000'
colors.clockOuterCircleUnselectableTextColor
The text color of the unselectable numbers displayed in the outer circle. (only used in combination with minimum
and maximum
option)
default: '#000000'
colors.hoverCircleColor
The color of the circle when hovering over an hour or minute.
default: '#DDDDDD'
colors.popupBackgroundColor
The background color of the popup.
default: '#FFFFFF'
colors.popupHeaderBackgroundColor
The background color of the popup header displayed only on the mobile phone.
default: '#0797FF'
colors.popupHeaderTextColor
The text color of the popup header displayed only on the mobile phone.
default: '#FFFFFF'
colors.selectorColor
The color of the time selector.
default: '#0797FF'
colors.selectorNumberColor
The text color of the number that is selected.
default: '#FFFFFF'
contextmenu
If true, the browser's or a custom context menu is shown on right click.
If false, the right click behaves like the left click and the clock is shown.
default: false
duration
If true, the hours can be greater than 23.
default: false
durationNegative
If true, the duration can be negative. This settings only has effect if the setting duration is set to true.
default: false
fonts.buttonFontSize
The font size of the buttons. These buttons are only displayed in the mobile version.
default: 20
fonts.clockInnerCircleFontSize
The font size of the numbers that are displayed in the inner circle.
default: 12
fonts.clockOuterCircleFontSize
The font size of the numbers that are displayed in the outer circle.
default: 14
fonts.fontFamily
The font family used to display the numbers.
default: 'Arial'
hideUnselectableNumbers
Set this option to true if you want to completely hide the unselectable numbers (in case you're using minimum
and maximum
option).
default: false
i18n.cancelButton
The name of the button to cancel the time change. Only displayed on mobile phones.
default: 'Cancel'
i18n.okButton
The name of the button to confirm the time change. Only displayed on mobile phones.
default: 'OK'
maximum
With this option you can define the maximum duration/time. Syntax: hh:mm, i.e. 8:30, 12:00, 24:00, 100:00, ...
default: '23:59'
minimum
With this option you can define the minimum duration/time. Syntax: hh:mm, i.e. 06:00, -10:00, -15:45, ...
default: '-23:59'
modeSwitchSpeed
The speed in milliseconds of the switch animation when changing between hour and minute selection.
default: 500
onlyShowClockOnMobile
If true, the clock time picker is not shown on Desktop version.
default: false
onAdjust
Called when the time value is been adjusting. Compared to onChange this function is called each time when the value is changing, also while dragging the time selector...
default: function(newValue, oldValue) {}
onChange
Called when the time value has been changed. This function is called when the input field is loosing its focus.
default: function(newValue, oldValue) {}
onClose
Called when timepicker popup has been closed.
default: function() {}
onModeSwitch
Called when timepicker is switching between hour and minute selection mode. Argument selectionMode is "HOUR" or "MINUTE".
default: function(selectionMode) {}
onOpen
Called when timepicker popup has been opened.
default: function() {}
popupWidthOnDesktop
The width of the popup in the Desktop version in pixels. On the mobile phone the width is automatically calculated.
default: 200
precision
When setting the precision to i.e. 5, user may only choose time in 5 minutes steps (8:00, 8:05, 8:10, ...). Valid values for precision are: 1, 5, 10, 15, 30, 60.
default: 1
required
If this option is set to true, a user cannot empty the field by hitting delete or backspace.
default: false
separator
The separator separating the hour and the minute parts.
default: :
useDurationPlusSign
If set to true, positive durations use the plus sign (+) as a prefix.
default: false
vibrate
If this is activated the mobile phone vibrates while changing the time.
default: true
Submit a GitHub Issues request.
Version 2.6.5
Version 2.6.4
Version 2.6.3
Version 2.6.2
contextmenu
added. See above in the Options section for explanation. Closes pull request #43.Version 2.6.1
jquery-clock-timepicker.min.js
in index.html to solve browser caching issue for new released versions.Version 2.6.0
$('.your-time-field').clockTimePicker('value');
or $('.your-time-field').clockTimePicker('val');
$('.your-time-field').clockTimePicker('value', '08:00');
or $('.your-time-field').clockTimePicker('val', '08:00');
Version 2.5.0
$('.your-time-field').clockTimePicker('value', '08:00');
$('.your-time-field').clockTimePicker('show');
$('.your-time-field').clockTimePicker('hide');
Version 2.4.0
Version 2.3.5
Version 2.3.4
onInputElementKeyUp
completely refactored to simplify and to solve issue #21.minimum
and maximum
values.Version 2.3.3
Version 2.3.2
precision
.alwaysSelectHoursFirst
inserted.Version 2.3.1
useDurationPlusSign
is set to true
Version 2.3.0
minimum
and maximum
options.hideUnselectableNumbers
option.clockInnerCircleUnselectableTextColor
and clockOuterCircleUnselectableTextColor
.afternoonHoursInOuterCircle
(Issue #16).Version 2.2.5
Version 2.2.4
Version 2.2.3
useDurationPlusSign
implemented.Version 2.2.2
Version 2.2.1
Version 2.2.0
Version 2.1.10
Version 2.1.9
Version 2.1.8
Version 2.1.7
Version 2.1.6
Version 2.1.5
Version 2.1.4
Version 2.1.3
Version 2.1.2
Version 2.1.1
Version 2.1.0
autosize
from true to false.required
added: If you don't want the user to empty the input element, you can set this option to true.onAddjust
added: This option is called on each adjustment of the value, including dragging the timeselector.maximum
and minimum
option.Version 2.0.0
Version 1.x
This software is made available under the open source MIT License. © 2024 Andreas Loeber and contributors
FAQs
A free jQuery Plug-in to select the time with a clock inspired by the Android time picker. This plugin works on Desktop and Mobile phones.
We found that jquery-clock-timepicker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.