Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
An opinionated clock-style vanilla-js timepicker.
Demo
"1"
->"01:00"
, "12"
->"12:00"
, "1234"
->"12:34"
"data-clocklet"
attribute to time input elementsT.B.D.
Default options can be set as properties of clocklet.defaultOptions
object.
Option names must be described in camelCase.
clocklet.defaultOptions.zIndex = 9999;
clocklet.defaultOptions.format = "hh:mm a";
Element-specific options can be specified as semicolon-separated data-clocklet
attribute value.
Option names must be described in kebab-case.
<input data-clocklet="class-name: my-clocklet-style; placement: top;">
Name | Type | Default | Description |
---|---|---|---|
class-name | string | "" | Class name to set to the root element of the popup. |
format | string | "HH:mm" | Time format (template) of the input element. Some tokens are replaced with the selected time value. See the format tokens section below. |
placement | "top" | "bottom" | "bottom" | Popup placement. |
alignment | "left" | "right" | "left" | Popup alignment. |
append-to | "body" | "parent" | "body" | The parent element into which the popup element will be inserted. |
z-index | number | string | "" | Popup z-order. If this value is an empty string, (1 + z-index of the input element) is used. |
Token | Range | Description |
---|---|---|
H | "0" .. "23" | Hour in 0-based 24-hour notation with no padding. |
HH | "00" .. "23" | Hour in 0-based 24-hour notation with zero padding. |
_H | " 0" .. "23" | Hour in 0-based 24-hour notation with space padding. |
h | "1" .. "12" | Hour in 1-based 12-hour notation with no padding. |
hh | "01" .. "12" | Hour in 1-based 12-hour notation with zero padding. |
_h | " 1" .. "12" | Hour in 1-based 12-hour notation with space padding. |
k | "1" .. "24" | Hour in 1-based 24-hour notation with no padding. |
kk | "01" .. "24" | Hour in 1-based 24-hour notation with zero padding. |
_k | " 1" .. "24" | Hour in 1-based 24-hour notation with space padding. |
m | "1" .. "59" | Minute with no padding. |
mm | "01" .. "59" | Minute with zero padding. |
_m | " 1" .. "59" | Minute with space padding. |
a | "am" | "pm" | Post or ante meridiem abbreviation in lowercase without periods. |
aa | "a.m." | "p.m." | Post or ante meridiem abbreviation in lowercase with periods. |
A | "AM" | "PM" | Post or ante meridiem abbreviation in uppercase without periods. |
AA | "A.M." | "P.M." | Post or ante meridiem abbreviation in uppercase with periods. |
Following events are raised on the input element by this library.
Type | Cancelable | event.details | Description |
---|---|---|---|
clocklet.opening | true | { options: {...} } | Raised before showing the clocklet popup. |
clocklet.opened | false | { options: {...} } | Raised after showing the clocklet popup. |
clocklet.closing | true | {} | Raised before hiding the clocklet popup. |
clocklet.closed | false | {} | Raised after hiding the clocklet popup. |
input | false | undefined | Raised after changing the input value. |
For example:
<input id="my-clocklet" data-clocklet>
<script>
document
.getElementById('my-clocklet')
.addEventListener('clocklet.opening', function (event) {
console.log(event.details.options);
if (DO_NOT_NEED_TIMEPICKER) {
event.preventDefault();
}
});
</script>
clocklet.defaultOptions
See default options section.
clocklet.open(inputElement[, options])
Show the timepicker for the specified inputElement
with the options
(optional).
clocklet.close()
Hide the timepicker.
WTFPL
FAQs
An opinionated clock-style vanilla-js timepicker
The npm package clocklet receives a total of 0 weekly downloads. As such, clocklet popularity was classified as not popular.
We found that clocklet demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.