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

smd-timepicker

v2.0.0

Published

React time picker with custom configurations

Downloads

16

Readme

smd-timepicker


alt text


 React time picker with custom configurations.
Provides all the necessary stylling and user friendly interaction,
Can able to modify the existing styling as well as can able to add custome css also.
24 hours format as well as 12 hours format and easy to understand.

JavaScript Style Guide

Install

npm install smd-timepicker

Usage

import React, { Component } from 'react'

import SMDTimePicker  from 'smd-timepicker'

class Example extends Component {
  render() {
    return <SMDTimePicker value='10:25 am' onChange={onSelectingTime}/>
  }
}

props

| Prop | Default Value & Type | Description | | :------------: |:---------------:| :---------------:| | onChange | onChange: (time: string) => void (function)| Captures the output in the format of user provided prop format or default format (hh:mm a)| | | | | | format | hh:mm a (string) | Can able to pass the format like hh:mm a or HH:mm | | | | | | value | '' (string) | If want pass default value as hh:mm a format or HH:mm format | | | | | | is24Hours | false (Boolean) | If we want 24 hours format then set this to true| | | | | | isRemoveInputSelector | false (Boolean) | If you don't want Time select options provide this as true | | | | | | hoursPlaceholder | HH {string) | For hours input placeholder | | | | | |minutesPlaceholder| MM {string) | For minutes input placeholder | | | | | | isIncludesSeconds | false {Boolean) | If you want seconds also to be included pass this prop as true value | | | | | |secondsPlaceholder| SS {string) | For seconds input placeholder | | | | | | inputStyles | {} (css styles object)| Set inline styles for input | | | | | | inputClass | '' (className) (css className string) | Can able to provide our app CSS classes to the inputs | | | | | | selectAMPMStyles | {} (css styles object)| Set inline styles for select AM or PM| | | | | | selectAMPMClass | '' (className) | Can able to provide our app CSS classes to the select AM or PM| | | | | | selectOptions|[{name:'AM',value:'am'},..]| If you want to change the name of select AM or PM as lowercase values or uppercase values or titlesase values, You can obtain those with css styles also | | | | | | timeSelectConfig | {timeOuterContainer: {}, timeInsideContainer: {}, selectSpecificData: { isSelectedBGcolor: 'lightgreen',isSelectedFontColor:'black',isHoveredBGcolor:'lightblue', isHoveredFontColor: 'black' } } | timeOuterContainer is to change the custom styles for the select input container, timeInsideContainer is to time data value inside container , selectSpecificData this object is to activated element styles |

Example 1

import React, { useState } from 'react'

import SMDTimePicker from 'smd-timepicker'

const App = () => {
  const [timeV, setTime] = useState('')

  const onSelectingTime = (time: string) => {
    console.log('app time is -- ', time)
    setTime(time)
  }

  return (
    <div>
      <h1>Selected time is -- {timeV}</h1>
      <div style={{ marginLeft: '100px' }}>
        <SMDTimePicker
          onChange={onSelectingTime}
          is24Hours={false}
		  value={timeV}
          isIncludesSeconds={false}
          inputClass=''
          inputStyles={{ width:'30px', height:'30px', color: 'blue', fontWeight:'bold' }}
          selectAMPMClass=''
          selectAMPMStyles={{ width:'60px', height:'30px'  }}
          timeSelectConfig={{
            selectSpecificData: { isSelectedBGcolor: 'orange', isHoveredBGcolor:"gray" },
            timeInsideContainer: {backgroundColor: "lightcyan"}
          }}
        />
      </div>
    </div>
  )
}

export default App

alt text

Example 2

import React, { useState } from 'react'

import SMDTimePicker from 'smd-timepicker'

const App = () => {
  const [timeV, setTime] = useState('')

  const onSelectingTime = (time: string) => {
    console.log('app time is -- ', time)
    setTime(time)
  }

  return (
    <div>
      <h1>Selected time is -- {timeV}</h1>
      <div style={{ marginLeft: '100px' }}>
        <SMDTimePicker
          onChange={onSelectingTime}
          is24Hours={true}
          value={timeV}
          isIncludesSeconds={true}
        />
      </div>
    </div>
  )
}

export default App


alt text


License

© sivasankula19