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

diabelb-material-ui-next-pickers

v0.0.16

Published

Datepicker and timepicker for material-ui next

Downloads

2

Readme

Material UI Next Pickers

Description

This repository act as a sample of creating a datepicker or timepicker in Material UI Next or it can be imported as a datepicker or timepicker component.

Prerequisite

npm install material-ui-next-pickers --save

Screenshot

Image of Material UI DatePicker Image of Material UI TimePicker

Options

Datepicker

name: string
label?: string
value: Date
onChange: (value:Date, event?:React.MouseEvent<HTMLElement>) => void
anchorOrigin?: {
  vertical: 'top' | 'center' | 'bottom'
  horizontal: 'left' | 'center' | 'right'
}
transformOrigin?: {
  vertical: 'top' | 'center' | 'bottom'
  horizontal: 'left' | 'center' | 'right'
}
disabled?: boolean
error?: string
dateDisabled?: (date:Date) => boolean
min?: Date
max?: Date
dateFormat?: string | ((date:Date) => string)
fullWidth?: boolean
dialog?: boolean
okToConfirm?: boolean
endIcon?: Node
className?: string
InputLabelProps?: InputLabelProps
InputProps?: InputProps
FormHelperTextProps?: FormHelperTextProps
CalendarProps?: CalendarProps

Calendar

action: (actions:any) => void // only resize event
value: Date
onChange: (value:Date, event?:React.MouseEvent<HTMLElement>) => void
closeCalendar: () => void
dateDisabled?: (date:Date) => boolean
min?: Date
max?: Date
okToConfirm?: boolean
classes?: {
  root?: string
  selectedDay?: string
  selectedDayText?: string
  selectedYear?: string
  selectedYearText?: string
}

Timepicker

name: string
label?: string
value: Date
onChange: (value:Date, event?:React.MouseEvent<HTMLElement> | React.TouchEvent<HTMLElement>) => void
selectableMinutesInterval?: number
anchorOrigin?: {
  vertical: 'top' | 'center' | 'bottom'
  horizontal: 'left' | 'center' | 'right'
}
transformOrigin?: {
  vertical: 'top' | 'center' | 'bottom'
  horizontal: 'left' | 'center' | 'right'
}
disabled?: boolean
error?: string
fullWidth?: boolean
dialog?: boolean
okToConfirm?: boolean
endIcon?: Node
className?: string
InputLabelProps?: InputLabelProps
InputProps?: InputProps
FormHelperTextProps?: FormHelperTextProps
ClockProps?: ClockProps

Clock

action: (actions:any) => void // only resize event
value: Date
onChange: (value:Date, event?:React.MouseEvent<HTMLElement> | React.TouchEvent<HTMLElement>) => void
closeClock: () => void
selectableMinutesInterval?: number
okToConfirm?: boolean
classes?: {
  root?: string
  digitalContainer?: string
  clockBackground?: string
  hand?: string
  textSelected?: string
  minuteDotSelected?: string
}

Basic setup

  1. Make sure you installed Material UI Next.
  2. Install this package via npm.
  3. Import this package and use like the following:
import {DateFormatInput, TimeFormatInput} from 'material-ui-next-pickers'

class YourComponent extends React.Component<{}, YourComponentState> {
  onChangeDate = (date:Date) => {
    console.log('Date: ', date)
    this.setState({date})
  } 
  onChangeTime = (time:Date) => {
    console.log('Time: ', time)
    this.setState({time})
  } 
  render() {
    const {date, time} = this.state
    return (
      <div>
        <DateFormatInput name='date-input' value={date} onChange={this.onChangeDate}/>
        <TimeFormatInput name='time-input' value={time} onChange={this.onChangeTime}/>
      </div>
    )
  } 
}
interface YourComponentState {
  date: Date
  time: Date
}