Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@commander-lol/react-kronos
Advanced tools
A fast, intuitive, and elegant date and time picker for React.
A fork of react-kronos
A fast, intuitive, and elegant date and time picker for React.
Rationale
Even though there are many React Date and/or Time components, I'm developing my own because none of them do everything that I need.
Key requirements:
- Separate date and/or time components (many only have date)
- Easily style-able from JS (not have to muck around in the css)
- Return multiple time formats (Date, Moment, ISO, string)
- Lightweight, use no jquery
- Active on focus, disappear on blur
- Efficient keyboard navigation
npm install @commander-lol/react-kronos
import Kronos from '@commander-lol/react-kronos'
<Kronos
date={this.state.datetime}
onChange={this.onChange}
/>
Props:
date
- Date(), Moment(), ISO, or string (if string, must match format
)time
- Date(), Moment(), ISO, or string (if string, must match format
)format
- string : Moment formatting of date / timeonChange
- function : native onChange methodonChangeDateTime
- function : change method called when there is a new valuereturnAs
- string : onChange format JS_DATE
, MOMENT
, ISO
, STRING
(default: same as input)min
- Date(), Moment(), ISO to set as the minimum datetimemax
- Date(), Moment(), ISO to set as the maximum datetimeminTime
- Date(), Moment(), ISO to set as the minimum time (only the time will be used)maxTime
- Date(), Moment(), ISO to set as the maximum time (only the time will be used)closeOnSelect
- boolean : closes the dropdown when a value is selected (default: true
)closeOnBlur
- boolean : closes the dropdown when the field is blurred (default: true
)disabled
- boolean : whether or not the input component is disabled. If true, the selector will not be visible regardless of the setting of visible
shouldTriggerOnChangeForDateTimeOutsideRange
- boolean: optionally allow dates outside min/max range to trigger onChanges (default: false
)preventClickOnDateTimeOutsideRange
- boolean: optionally prevent users from clicking on dates outside min/max range (default: false
)hideOutsideDateTimes
- boolean: optionally hide times that do not pass validation (default: false
)placeholder
- string : placeholder text when there is no valuename
- string : name used for the input formoptions:
color
- string : the highlight color in the UI as a hexcorners
- number : the pixel size of rounded corners (default: 4
)font
- string : the font family (default: Source Sans Pro
)moment:
- object : Moment locale customization
lang
- string : language (default: en
for english)settings
- object : properties to override as an object (default: { week: { dow: 1 }, weekdaysMin: ['M', 'T', 'W', 'T', 'F', 'S', 'S'] }
)format
: - object : Moment formatting for cell titles
today
: - string : default: Today
year
: - string : default: YYYY
month
: - string : default: MMM
day
: - string : default: D
hour
: - string : default: h:mm a
Needed
styles
- granular styling (overwrite any style, or provide entire theme)1.5.0
hideOutsideDateTimes
to hide times that cannot be selected #45 (thanks Commander-lol)timeStep
prop to configure the number of minutes in an interval #48 (thanks ochervak)FAQs
A fast, intuitive, and elegant date and time picker for React.
The npm package @commander-lol/react-kronos receives a total of 1 weekly downloads. As such, @commander-lol/react-kronos popularity was classified as not popular.
We found that @commander-lol/react-kronos 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.