Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-ts-timepicker
Advanced tools
Readme
This is a lightweight and easy to use time picker without dependencies for React, written in Typescript and thoroughly covered by unit tests.
https://codesandbox.io/s/52ll738ljk
Install plugin with npm:
$ npm install react-ts-timepicker
Or yarn:
$ yarn add react-ts-timepicker
React 15.6+
import React, { Component } from 'react';
import TimePicker from 'react-ts-timepicker';
class App extends Component {
state = {
value: '10:00',
}
onChange = value => {
this.setState({ value })
}
render() {
return (
<div>
<TimePicker
onChange={this.onChange}
value={this.state.value}
/>
</div>
);
}
}
Property | Type | Default value | Description |
---|---|---|---|
value | string / Date / null | null | The value of the input. |
timeFormat | string | hh:mma | moment.js like time format string. See below for more information. |
name | string | timepicker | The name of the input. |
onChange | function | () => {} | Function called when the user picks a valid time. Type of the value will be the same as value has. |
step | number | 30 | Step in minutes between two suggestions. |
minTime | string / null | null | Suggestions start time. |
maxTime | string / null | null | Suggestions end time. Without this prop suggestions max time equals one day. |
includeMax | boolean | true | Whether or not include suggestions max time. |
hideOnScroll | boolean | false | Whether or not hide suggestions on window scroll. |
allowOnlySuggestions | boolean | false | Allow on suggestions values to be entered to the input. Input value will be rounded to the nearest suggestion. |
className | string | '' | Class name of the wrapping div. Can be used for overriding default time picker styles. |
inputClass | string | '' | Class name of the input element. |
appendTo | string / null | body | Element where the suggestions are appended. Takes either string to use as a selector or null to append suggestions to time picker wrapper itself. |
Input | Example | Description |
---|---|---|
H HH | 0..23 | Hours (24 hour time) |
h hh | 1..12 | Hours (12 hour time used with a A.) |
a A | am pm | Post or ante meridiem (Note the one character a p are also considered valid) |
m mm | 0..59 | Minutes |
s ss | 0..59 | Seconds |
This project is licensed under the MIT License .
FAQs
Simple timepicker for React
The npm package react-ts-timepicker receives a total of 26 weekly downloads. As such, react-ts-timepicker popularity was classified as not popular.
We found that react-ts-timepicker 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.