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

mtwtfss-calendar

v0.4.2

Published

Datepicker widget react component

Downloads

11

Readme

React Input Calendar

React component for calendar widget.

Installation

React Input Calendar is available as an npm package.

npm install react-input-calendar

Use browserify and reactify for dependency management and JSX transformation.

All styles written in CSS and are in file input-component.css.

Demo

http://rudeg.github.io/react-input-calendar

Usage

var Calendar = require('react-input-calendar');
React.render(
  <Calendar
    format="DD/MM/YYYY"
    date="4-12-2014"
  />,
  document.body
);

Dependencies

React

Moment-range

Font-Awesome

API

props.format

Type: String

Default: 'MM-DD-YYYY'

Allowed Keys: All formats supported by moment.js

Format of date, which display in input and set in date property.

props.parsingFormat

Type: String or Array

Default: 'props.format'

Allowed Keys: All formats supported by moment.js

This property allows the parsing format to be different to the display format. Format or Formats could be used to parse manually entered dates. The parsing does only happen if the date was entered manually and on blur of the input field gets called.

props.date

Type: String or Date

Default: Current date

Set initial date value.

props.minDate

Type: String or Date

Defaults: null

Set the selectable minimum date.

props.maxDate

Type: String or Date

Defaults: null

Set the selectable maximum date.

props.minView

Type: Int (from 0 to 2)

Default: 0 (DaysView)

Set minimal view. Values:

0 - days

1 - months

2 - years.

props.computableFormat

Type: String

Default: 'MM-DD-YYYY'

Allowed Keys: All formats supported by moment.js

Format of date for the onChange event. Default on the date format (ISO 8601) to ease the save of data.

props.strictDateParsing

Type: Boolean

Defaults: false

If set true, the parsing process will catch bad dates and does not try to parse the date with the native js date function and does not set the date to now either. Therefore the computed date will be reported as 'Invalid date'.

props.onChange

Type: Function

Default: null

Set a function that will be triggered whenever there is a change in the selected date. It will return the date in the props.computableFormat format.

props.onBlur

Type: Function

Default: null

Set a function that will be triggered when the input field is blurred. It will return the event and the date in the props.computableFormat format.

props.closeOnSelect

Type: Boolean

Default: undefined

Define state when date picker would close once the user has clicked on a date.

props.openOnInputFocus

Type Boolean

Default: undefined

Setting this value to true makes the calendar widget open when the iput field is focused.

props.hideIcon

Type Boolean

Default: false

If true, the icon next to the input field will not be shown. Make sure you set openOnInputFocus to true if using this.

props.placeholder

Type: String

Default: undefined

Value to show in the input text box if no date is set.

props.inputFieldId

Type: String

Default: null

Define the ID of the input field where the date picker represents it's value. This can be useful when the date picker is used with a label element. The label element can be bound to the input field using the label for attribute.

props.inputFieldClass

Type: String

Default: 'input-calendar-value'

Define the class name of the input field where the date picker represents its value.

License

MIT