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

react-calendar-mobile

v0.1.6

Published

A calendar component for mobile device

Downloads

732

Readme

React Calendar Mobile

React Calendar Mobile is a component very easy to use with no extra effort. It can be used in any project with great performance! Different from other calendar/date picker components, this component uses touches and scrolls to move to different months or weeks like native calendar on mobile device. It supports both monthly and weekly view.

点此阅读简体中文文档

How to install

npm install react-calendar-mobile --save

How to use

ES6

import Calendar from 'react-calendar-mobile';

CommonJS

var Calendar = require('react-calendar-mobile');

Locale / International

React Calendar Component supports locale format as Javascript Date API provides. Users can pass value to i18n, weekdayFormat, monthFormat, yearFormat to localize the calendar. More details displays in the Properties table.

Properties

| Name | Type | Default | Description | |---------------|-------------|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | selectedDate | String/Date | new Date() | The date selected on calendar. Default to today's date. | | startDateAt | String/Date | new Date() | The date of calendar displaying starts at. e.g., startDateAt is 2017-02-01 if the calendar displays February 2017. | | startOnMonday | Boolean | false | If false, week starts from Sunday, otherwise, from Monday. | | decorate | object | {} | It indicates if there is any event on specific day. A key/value object that maps decorates to calendar. Key format is "YYYY-MM-DD", value can be any value, e.g. {"2017-02-15": true} will add an origin dot under the date of 2017-02-15 on calendar which indicates that there is/are events on that day. | | view | String | "month" | Value will be "month"/"week". If set to "month", then a monthly calendar will be displayed, otherwise, it displays a week. | | className | String | "" | Customized class for the Calendar. | | i18n | String | "en-US" | Optional. A string with a BCP 47 language tag, or an array of such strings. | | weekdayFormat | String | "narrow" | The representation of the weekday. Possible values are "narrow", "short", "long". | | monthFormat | String | "long" | The representation of the month. Possible values are "numeric", "2-digit", "narrow", "short", "long". | | yearFormat | String | "numeric" | The representation of the year. Possible values are "numeric", "2-digit". | | onSelectDate | Function | | Callback function when a date is selected. Output of the selected value is a Date object and is passed in as the first argument of this function. | | onChange | Function | | Callback function when calendar scrolls to a different month or week. Output is a Date object and value is the start date of the month or week displaying. Passed in as the first argument of this function. |

Style

| Class Name | Description | |----------------------------------|------------------------------------------------------------------------------------------------| | .react-calendar | root div of calendar. | | .react-calendar__header | header div of calendar, where year and month display | | .react-calendar__year | year div of calendar. | | .react-calendar__month | month div of calendar. | | .react-calendar__main | main body div of calendar. | | .react-calendar__weekdays | weekdays title div of calendar. | | .react-calendar__weekday | each weekday title div of calendar. | | .react-calendar__days | days root div of calendar. | | .react-calendar__day | each day div of calendar. use .react-calendar__day span for date text style. | | .react-calendar__day--today | today's date div. | | .react-calendar__day--othermonth | dates of other months div. | | .react-calendar__day--selected | selected date div. | | .react-calendar__day--decorate | date with decorates on. To modify decorate's style, use .react-calendar__day--decorate:after |

Getting Started

To play it yourself, you can clone this repo and run the example in your local space.

Or you can play with the picker Online here

git clone https://github.com/jessemao/react-calendar-mobile.git
cd react-calendar-mobile && cd example
npm install
npm start

License

MIT