New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-month-selector

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-month-selector

Swipable month selector in react native

  • 1.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
50
decreased by-32.43%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-month-selector

This package lets you select months. It also allows you to use swipe gestures to navigate between pages.

Install

npm install react-native-month-selector --save
yarn add react-native-month-selector

Props

ParamsTypeDefaultDescription
selectedDatemoment.Moment (a valid moment.js instance)moment()currently highlighted / selected month
currentDatemoment.Momentmoment()today's date
maxDatemoment.Momentmoment()the maximum date than can be shown
minimumDatemoment.Momentmoment("01-01-2000", "DD-MM-YYYY")the mimimum date than can be shown
selectedBackgroundColorstring"#000"the color of the highlight for the seleced month
selectedMonthTextStyleTextStyle{ color: "#fff" }text style for the selected month
seperatorHeightnumber1height of the separators
seperatorColorstring"#b6c3cb"color of the separators
nextIconJSX.Elementnullcustom react component for the next button
prevIconJSX.Elementnullcustom react component for the prev button
nextTextstring"Next"custom text for the next button
prevTextstring"Prev"custom text for the prev button
containerStyleViewStylenullcustom style for the container
yearTextStyleTextStylenullcustom style for the year text
monthTextStyleTextStylenullcustom style of the text for the months
currentMonthTextStyleTextStylenullcustom style for the current month text
initialViewmoment.Momentmoment()which month should be selected initially
onMonthTapped(month: moment.Moment) => any(month) => {}function called when month is pressed
onYearChanged(year: moment.Moment) => any(year) => {}function called when the year is changed (when we navigate pages)
monthDisabledStyleTextStyle{ color: "#00000050" }text style for disabled months
localeLanguagestring"en"specify the localization language for moment.js
localeSettingsmoment.LocaleSpecification{}to update the moment.js localization settings
swipablebooleanfalseenables swiping between pages
velocityThresholdnumber0.3Velocity that has to be breached in order for swipe to be triggered (vx and vy properties of gestureState)
directionalOffsetThresholdnumber80Absolute offset that shouldn't be breached for swipe to be triggered (dy for horizontal swipe, dx for vertical swipe)
gestureIsClickThresholdnumber5Absolute distance that should be breached for the gesture to not be considered a click (dx or dy properties of gestureState)

Sample Usage

  <View style={styles.container}>
      <Text style={styles.welcome}>
        Selected Month is { this.state.month && this.state.month.format('MMM YYYY')}
      </Text>
      <MonthSelectorCalendar
          selectedDate={this.state.month}
          monthTapped={(date) => this.setState({ month: date })}
      />
    </View>

Month Calendar

I'm open to keep this updated. Please open PRs!

Contributors

  • vinodkumar8
  • is343
  • isaaclem

Keywords

FAQs

Package last updated on 17 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc