npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-ts-timepicker

v0.1.2

Published

Simple timepicker for React

Downloads

137

Readme

React TS Timepicker

npm version dependencies Build Status Coverage Status

This is a lightweight and easy to use time picker without dependencies for React, written in Typescript and thoroughly covered by unit tests.

Demo

https://codesandbox.io/s/52ll738ljk

Installation

Install plugin with npm:

$ npm install react-ts-timepicker

Or yarn:

$ yarn add react-ts-timepicker

Compatibility

React 15.6+

Basic usage

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>
    );
  }
}

Configuration

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.

Time formats

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

License

This project is licensed under the MIT License .