Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

material-ui-custom-datepicker

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

material-ui-custom-datepicker

material-ui datepicker connected with textfield

  • 1.0.33
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-60%
Maintainers
1
Weekly downloads
 
Created
Source

material-ui-custom-datepicker

Custom DatePicker component, that includes connected material-ui DatePicker and TextField components. react-input-mask is used for cutting useless symbols. There is common presence, max value, min value and date format validation.

Installing

npm install material-ui-custom-datepicker

Usage

import React from "react";
import {DatePicker} from "material-ui-custom-datepicker";


class myDatePicker extends React.Component{
  constructor(props) {
    super(props);
    this.state = {
      value: new Date()
    }
  }  
  
  handleChange = (event, value) => {
    this.setState({value});
  }
    
  render(){
    return (
      <DatePicker
        name="birthDate"
        value={this.state.value}
        onChange={this.handleChange}  
        floatingLabelText="Birthday"
        autoOk
        cancelLabel="Back"
        minDate={new Date(1900, 0, 1)}
        maxDate={new Date(2100, 0, 1)}
      />
    );
  }
}

Component support all default DatePicker and TextField material-ui properties. Additional ones are:

  • invalidDateError - invalid date format error
  • maxDateError - "too late date" error
  • minDateError - "too early date" error
  • dateInputFormat - date format in TextField
  • dateValueFormat - date value format
  • maskChar - maskChar of react-input-mask
  • mask - mask of react-input-mask

In max and min date errors max and min values are inserting instead of "{date}".

FAQs

Package last updated on 20 Sep 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc