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-js

v1.0.7

Published

Pure js calendar

Downloads

6

Readme

react-native-calendar-js

日历_纯js

github: https://github.com/90Mark/react-native-calendar-js

支持'点'和'文字'标记

效果:

Image text

Image text

Image text

Image text

calendarStyle 支持的外部设置样式

本月文字: textDefStyle:{color:'#',fontSize:11} 灰色文字: textAshStyle:{color:'#',fontSize:11} 选中文字: textSelStyle:{color:'#',fontSize:11} 今天文字: textTodayStyle:{color:'#',fontSize:11}

选中的圈圈 bgSelStyle:{backgroundColor:'#'} 今天的圈圈 bgTodayStyle:{backgroundColor:'#'}

没有选中的今天的背景 bgTodayUnSelStyle
没有选中的今天的文字 textTodayUnSelStyle

日背景色 bgUnSelStyle: {backgroundColor:'#'}

周头文字 textWeekTitle:{color:'#',fontSize:8} 周头背景 bgWeekTitle:{backgroundColor:'#'}

标记的样式: markStyle={'point','text'} 小圆点 / 文字

标记的style: markPointTodayStyle={width:8,height:8, backgroundColor:'#',borderRadius:4} markPointTodayStyle={width:8,height:8, backgroundColor:'#',borderRadius:4}

背景色,文字大小,文字颜色 标记的style: markTextTodayStyle={ color:'#',fontSize:8} 标记的style: markTextStyle={ color:'#',fontSize:8}

isOpen={false} 是否展开日历

markDic 想标记的数据,支持格式:markDic = { 20190201: { isMark: 1 }, 20190216: { isMark: 1 }, 20190705: { isMark: 1 }, 20190720: { isMark: 1 }, 20190730: { isMark: 1 } }

export function: selectSomeMonth 选中某月 selectSomeDay 跳转至某天

使用方法

/**
 * Created by mark on 2019/8/6
 *
 */

import React, { Component } from 'react'
import {
  TouchableWithoutFeedback,
  View,
  Dimensions,
  Text
} from 'react-native'

import { CalendarList } from 'react-native-calendar-js'

const { width } = Dimensions.get('window')
let cellWidth = parseInt(width / 7)
let viewHeight = cellWidth * 6

export default class TestIndex extends Component {
  constructor () {
    super()
    this.state = {}
  }

  render () {
    let markDic = {
      20190201: { isMark: 1 },
      20190216: { isMark: 1 },
      20190705: { isMark: 1 },
      20190720: { isMark: 1 },
      20190730: { isMark: 1 }
    }
    return (
      <View style={{
        flex: 1,
        width: '100%',
        height: '100%',
        alignItems: 'center',
        backgroundColor: '#fff'
      }}>
        <View style={{ width: '100%', height: 80, backgroundColor: '#eee', paddingTop: 30, flexDirection: 'row' }}>
          <TouchableWithoutFeedback
            onPress={this._gotoDay}>
            <Text style={{ marginLeft: 20, width: 60, height: 40, backgroundColor: '#f00' }}>返回今天</Text>
          </TouchableWithoutFeedback>
          <TouchableWithoutFeedback
            onPress={this._gotoMonth}>
            <Text style={{ marginLeft: 20, width: 80, height: 40, backgroundColor: '#f00' }}>跳转至2月</Text>
          </TouchableWithoutFeedback>
        </View>
        <CalendarList
          ref={(r) => { this.calendarList = r }}
          selectMonth={new Date()}
          selectDay={new Date()}
          width={width}
          height={viewHeight}
          isOpen={false}
          onChangeMonth={this._onChangeMonth}
          clickItem={this._clickItem}
          clickUndefined={this._clickUndefined}
          lastPageCallback={this._lastPageCallback}
          calendarStyle={{
            backgroundColor: '#fff',
            dayStyle: {
              backgroundColor: '#fff',
              markStyle: 'point'
            }
          }}
          markDic={markDic}
        />
        <View style={{ flex: 1, backgroundColor: '#fff', justifyContent: 'center', alignItems: 'center' }}>
          <Text>{'hello world'}</Text>
          <Text>{this.state.month}+++{this.state.day}</Text>
        </View>
      </View>
    )
  }

  _onChangeMonth = (date) => {
    console.log('test 当前月', date)
    this.setState({
      month: `${date.getFullYear()}/${date.getMonth() + 1}`
    })
  }

  _clickItem = (date) => {
    console.log('test 选中某天', date)
    this.setState({
      day: `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`
    })
  }

  _clickUndefined = (isClick) => {
    if (isClick) {
      console.log('test 日期超出,选不了' + isClick)
    }
  }

  _lastPageCallback = () => {
    console.log('test 第一页/最后一页,翻不动了')
  }

  // 选中某月
  _gotoMonth = () => {
    let date = new Date()
    date.setFullYear(2019)
    date.setMonth(1) // 设置 Date 对象中月份 (0 ~ 11)
    date.setDate(1)
    this.calendarList && this.calendarList.selectSomeMonth(date)
  }

  // 跳转至某天
  _gotoDay = () => {
    this.calendarList && this.calendarList.selectSomeDay(new Date())
  }
}