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

rn-lunar-calendars

v0.1.3

Published

Lunar calendar for Vietnam, China

Readme

rn-lunar-calendars

React Native lunar calendar components and utilities for Vietnam and China (years 1800–2199), with holiday data, theming, and TypeScript support.

English | Tiếng Việt | 中文

Features

  • Complete lunar calendar range (1800–2199)
  • Vietnam and China holiday support
  • Customizable UI with theme system
  • iOS, Android, Web
  • Full TypeScript support
  • Functional components with React Hooks
  • Zodiac, Heavenly Stems/Branches, Five Elements info

Installation

npm install rn-lunar-calendars
# or
yarn add rn-lunar-calendars

Peer dependencies:

npm install react-native-calendars date-fns
# or
yarn add react-native-calendars date-fns

Basic usage

LunarCalendar

import React, { useState } from 'react';
import { View } from 'react-native';
import { LunarCalendar, CalendarDay } from 'rn-lunar-calendars';

export default function App() {
  const [selectedDate, setSelectedDate] = useState<Date>(new Date());

  return (
    <View style={{ flex: 1 }}>
      <LunarCalendar
        current={new Date()}
        selected={selectedDate}
        onDayPress={(day: CalendarDay) => setSelectedDate(day.date)}
        showLunar
        showHolidays
      />
    </View>
  );
}

LunarDatePicker

import React, { useState } from 'react';
import { View, Button } from 'react-native';
import { LunarDatePicker } from 'rn-lunar-calendars';

export default function PickerExample() {
  const [selectedDate, setSelectedDate] = useState<Date>(new Date());
  const [visible, setVisible] = useState(false);

  return (
    <View style={{ flex: 1, justifyContent: 'center' }}>
      <Button title="Pick date" onPress={() => setVisible(true)} />
      <LunarDatePicker
        value={selectedDate}
        onChange={setSelectedDate}
        visible={visible}
        onClose={() => setVisible(false)}
        showLunar
        showHolidays
      />
    </View>
  );
}

LunarDateInfo

import React from 'react';
import { View } from 'react-native';
import { LunarDateInfo, CalendarDay } from 'rn-lunar-calendars';

export default function InfoExample({ day }: { day: CalendarDay }) {
  return (
    <View style={{ flex: 1 }}>
      <LunarDateInfo
        day={day}
        showZodiacInfo
        showCanChiInfo
        showHolidayInfo
      />
    </View>
  );
}

Theming

import { LunarCalendar, DEFAULT_THEME } from 'rn-lunar-calendars';

const customTheme = {
  ...DEFAULT_THEME,
  backgroundColor: '#f8f9fa',
  calendarBackground: '#ffffff',
  selectedDayBackgroundColor: '#007AFF',
  todayTextColor: '#007AFF',
  dayTextColor: '#2d4150',
  lunarTextColor: '#666666',
  lunarTextSize: 12,
};

<LunarCalendar theme={customTheme} showLunar showHolidays />

Utilities

Date conversions

import { solarToLunar, lunarToSolar } from 'rn-lunar-calendars';

const lunarDate = solarToLunar(new Date(2024, 0, 1));
const solarDate = lunarToSolar(2024, 1, 1);

Holidays

import { getHolidays, isHoliday, getNextHoliday } from 'rn-lunar-calendars';

const holidays = getHolidays(2024, 'VN');
const { isHoliday: isHolidayDay, holiday } = isHoliday(new Date());
const nextHoliday = getNextHoliday(new Date());

Zodiac and Heavenly Stems/Branches

import { getZodiacInfo, getCanChiInfo } from 'rn-lunar-calendars';

const zodiacInfo = getZodiacInfo(2024);
const canChiInfo = getCanChiInfo(2024);

API Reference

LunarCalendar Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | current | Date | new Date() | Current date | | selected | Date | undefined | Selected date | | onDayPress | (day: CalendarDay) => void | undefined | Day press callback | | onMonthChange | (date: Date) => void | undefined | Month change callback | | showLunar | boolean | true | Show lunar info | | showHolidays | boolean | true | Show holidays | | theme | CalendarTheme | DEFAULT_THEME | Custom theme | | minDate | Date | undefined | Min date | | maxDate | Date | undefined | Max date |

LunarDatePicker Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | value | Date | new Date() | Value | | onChange | (date: Date) => void | undefined | Change callback | | visible | boolean | false | Visible | | onClose | () => void | undefined | Close callback | | title | string | 'Pick date' | Picker title |

LunarDateInfo Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | day | CalendarDay | required | Day info | | showZodiacInfo | boolean | true | Show zodiac info | | showCanChiInfo | boolean | true | Show Heavenly Stems/Branches | | showHolidayInfo | boolean | true | Show holiday info |

Contributing

We welcome contributions! Please read CONTRIBUTING.md.

License

MIT — see LICENSE.