New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ciqu-react-calendar

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ciqu-react-calendar

[![npm package](https://img.shields.io/npm/v/ciqu-react-calendar.svg?style=flat)](https://www.npmjs.org/package/ciqu-react-calendar) [![Dependency Status](https://gemnasium.com/badges/github.com/ciqulover/react-calendar.svg)](https://gemnasium.com/github.

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
31
decreased by-34.04%
Maintainers
1
Weekly downloads
 
Created
Source
React-Calendar

npm package Dependency Status

Install

npm i ciqu-react-calendar

OR

yarn add ciqu-react-calendar

Example


import React from 'react'
import ReactDom from 'react-dom'
import moment from 'moment'
import Calendar from 'ciqu-react-calendar'

class MyCalendar extends React.Component {

  constructor(props) {
    super(props)
    this.state = {
      value: moment()
    }
  }

  onChange = (value, inputValue) => {
    console.log(value.format('YYYY-MM-DD'))
    this.setState({value})
  }

  onOpenChange = (status) => {
    console.log('open status: ' + status)
  }

  disabledDate = (currentDate, inputValue) => {
    return false
  }

  render() {
    const {onChange, onOpenChange, disabledDate} = this
    return <div>
      <Calendar
        onChange={onChange}
        value={this.state.value}
        allowClear={true}
        disabled={false}
        placeholder={'please input date'}
        format={'YYYY-MM-DD'}
        onOpenChange={onOpenChange}
        disabledDate={disabledDate}
      />
    </div>
  }
}

ReactDom.render(
  <MyCalendar/>,
  document.getElementById('el')
)

API

interface CalendarProps {
  // when input value changes, this callback will be called, default null
  onChange?(value?: Moment, inputValue?: string): void
  
  // fired when datepicker shows or hides, default null
  onOpenChange?(status?: boolean): void
  
  // when returned true, the target date cannot be picked, default null
  disabledDate?(currentDate: Moment, inputValue: string): boolean
  
  // allow to clear the picked date, default true
  allowClear?: boolean
  
  // if true, datepicker is disabled, default false
  disabled?: boolean
  
  // control whether datepicker shows or hides, default false
  open?: boolean,
  
  placeholder?: string
  
  // moment format string, default 'YYYY-MM-DD'
  format?: string

  className?: string
  
  // the value under control, default moment()
  value?: Moment
  
  // the default value 
  defaultValue?: Moment
}

License

MIT

FAQs

Package last updated on 03 Oct 2017

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