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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-calendar-android

v0.0.6

Published

A simple material-themed calendar for react native android

Downloads

25

Readme

react-native-calendar-android

A simple material-themed calendar for react native android

Installation Android

  1. npm install --save react-native-calendar-android

Note: Since [email protected], you should use [email protected] and above

  1. In android/settings.gradle

    ...
    include ':ReactNativeCalendarAndroid', ':app'
    project(':ReactNativeCalendarAndroid').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-calendar-android/android')
  2. In android/app/build.gradle

    ...
    dependencies {
        ...
        compile project(':ReactNativeCalendarAndroid')
    }
  3. Register module (in MainActivity.java)

    4.1. With RN < 0.19.0

     ```java
     import com.chymtt.reactnativecalendar.CalendarPackage; // <----- import
    
     public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
       ......
    
       @Override
       protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         mReactRootView = new ReactRootView(this);
    
         mReactInstanceManager = ReactInstanceManager.builder()
           .setApplication(getApplication())
           .setBundleAssetName("index.android.bundle")
           .setJSMainModuleName("index.android")
           .addPackage(new MainReactPackage())
           .addPackage(new CalendarPackage())              // <------ add here
           .setUseDeveloperSupport(BuildConfig.DEBUG)
           .setInitialLifecycleState(LifecycleState.RESUMED)
           .build();
    
         mReactRootView.startReactApplication(mReactInstanceManager, "ExampleRN", null);
    
         setContentView(mReactRootView);
       }
       ......
     }
     ```

    4.2. With RN >= 0.19.0

     ```java
     import com.chymtt.reactnativecalendar.CalendarPackage; // <----- import
    
     public class MainActivity extends ReactActivity {
         ...
    
         @Override
         protected List<ReactPackage> getPackages() {
           return Arrays.<ReactPackage>asList(
             new MainReactPackage(),
             new CalendarPackage() // <------ add here
           );
         }
     }
     ```

Usage


var Calendar = require('react-native-calendar-android');
...

  render() {
    return (
      <Calendar
          width={300}
          topbarVisible={true}
          arrowColor="#dafacd"
          firstDayOfWeek="monday"
          showDate="all"
          currentDate={[ "2016/12/01" ]}
          selectionMode="multiple"
          selectionColor="#dadafc"
          selectedDates={[ "2015/11/20", "2015/11/30", 1448745712382 ]}
          onDateChange={(data) => {
            console.log(data);
          }} />
    );
  }

Notes

The view is a grid with 7 tiles wide and 8 tiles high (with topbarVisible=true), or 7 tiles high (with topbarVisible=false)

The size of each tile is automatically calculated based on the provided width.

Props

int width (required)

Provide the width of the calendar. The height will be calculated based on width and topbarVisible.

boolean topbarVisible (default = true)

Show/hide the top bar which contains the month's title and arrows to go to previous or next months.

string arrowColor

A string color in the format #RRGGBB or #AARRGGBB. It changes color of the top bar's arrows accordingly.

enum firstDayOfWeek (default = 'sunday')

enum [ 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday' ]

Set the first day of the week.

enum showDate (default = 'current')

enum [ 'all', 'current' ]

If set to current, only show dates within current month. If set to all, show dates from previous and current months too.

array currentDate

Set the focus of the calendar. Due to some limitations, you must provide an array with only one element, which is the currentDate. currentDate can be a string in the format yyyy/mm/dd or a timestamp.

enum selectionMode (default = 'single')

enum [ 'none', 'single', 'multiple' ]

Set the selection mode.

  • none: you cannot select date
  • single: you can only select one date at a time
  • multiple: you can select multiple dates

string selectionColor

Set the color of the selection circle. Should be a color in the format #RRGGBB or #AARRGGBB.

array selectedDates

An array of dates in the format yyyy/mm/dd or timestamp. Set the selected dates on the calendar.

Event

onDateChange(data)

Called when user select/deselect a date. The returned data is { date: 'yyyy/mm/dd', selected: boolean }

Questions or suggestions?

Feel free to open an issue Pull requests are also welcome

Credit

Big thanks to @prolificinteractive for their awesome Material Calendar View