All Projects → rghorbani → React Native Persian Calendar Picker

rghorbani / React Native Persian Calendar Picker

Licence: mit
Persian Calendar Picker Component for React Native

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Persian Calendar Picker

Recyclercalendarandroid
A simple DIY library to generate your own custom Calendar View using RecyclerView, written in Kotlin
Stars: ✭ 83 (+0%)
Mutual labels:  calendar, calendar-component
Primedatepicker
PrimeDatePicker is a tool that provides picking a single day, multiple days, and a range of days.
Stars: ✭ 292 (+251.81%)
Mutual labels:  calendar, calendar-component
Customizablecalendar
CustomizableCalendar is a library that allows you to create your calendar, customizing UI and behaviour
Stars: ✭ 214 (+157.83%)
Mutual labels:  calendar, calendar-component
Eventscalendar
Events Calendar is a user-friendly library that helps you achieve a cool Calendar UI with events mapping. You can customise every pixel of the calendar as per your wish and still achieve in implementing all the functionalities of the native android calendar in addition with adding dots to the calendar which represents the presence of an event on the respective dates. It can be done easily, you are just a few steps away from implementing your own badass looking Calendar for your very own project!
Stars: ✭ 188 (+126.51%)
Mutual labels:  calendar, calendar-component
Calendarview
An Easy to Use Calendar for iOS (Swift 5.0)
Stars: ✭ 429 (+416.87%)
Mutual labels:  calendar, calendar-component
Angular Calendar
A calendar component for Angular 12.0+ that can display events on a month, week or day view. The successor of angular-bootstrap-calendar.
Stars: ✭ 2,312 (+2685.54%)
Mutual labels:  calendar, calendar-component
UltraWeekCalendar
UltraWeekCalendar - Clean UI to select day through weeks
Stars: ✭ 29 (-65.06%)
Mutual labels:  calendar, calendar-component
Calendar Ios
Calendar View
Stars: ✭ 154 (+85.54%)
Mutual labels:  calendar, calendar-component
React Timeline Gantt
A react Timeline component with virtual rendering
Stars: ✭ 347 (+318.07%)
Mutual labels:  calendar, calendar-component
Cvcalendar
A custom visual calendar for iOS 8+ written in Swift (>= 4.0).
Stars: ✭ 3,435 (+4038.55%)
Mutual labels:  calendar, calendar-component
Vacalendar
Custom Calendar for iOS in Swift
Stars: ✭ 184 (+121.69%)
Mutual labels:  calendar, calendar-component
Calendarview
Android上一个优雅、万能自定义UI、仿iOS、支持垂直、水平方向切换、支持周视图、自定义周起始、性能高效的日历控件,支持热插拔实现的UI定制!支持标记、自定义颜色、农历、自定义月视图各种显示模式等。Canvas绘制,速度快、占用内存低,你真的想不到日历居然还可以如此优雅!An elegant, highly customized and high-performance Calendar Widget on Android.
Stars: ✭ 7,998 (+9536.14%)
Mutual labels:  calendar, calendar-component
Vue Hash Calendar
移动端日期、时间选择插件,日期选择面板以日历形式展示。上下滑动切换周/月模式。支持两种模式:1,月模式,左右滑动切换月份。2、周模式,左右滑动切换周。
Stars: ✭ 163 (+96.39%)
Mutual labels:  calendar, calendar-component
Recal
A minimal, accessible React/Preact calendar component using modern CSS.
Stars: ✭ 191 (+130.12%)
Mutual labels:  calendar, calendar-component
Xamarin.plugin.calendar
Calendar plugin for Xamarin.Forms
Stars: ✭ 159 (+91.57%)
Mutual labels:  calendar, calendar-component
GCCalendar
A customizable calendar view for iOS 9+ written in Swift.
Stars: ✭ 53 (-36.14%)
Mutual labels:  calendar, calendar-component
Vue Functional Calendar
Vue.js Functional Calendar | Component/Package
Stars: ✭ 314 (+278.31%)
Mutual labels:  calendar, calendar-component
Vue Calendar
🏆 基于 vue 2.0 开发的轻量,高性能日历组件
Stars: ✭ 828 (+897.59%)
Mutual labels:  calendar, calendar-component
Yycalendar
Simple and Clear Calendar
Stars: ✭ 46 (-44.58%)
Mutual labels:  calendar, calendar-component
Calendarview2
Calendar view for Android. Pretty.
Stars: ✭ 72 (-13.25%)
Mutual labels:  calendar

React Native Jalaali (Persian) Calendar

NPM Version Build Status

This is a Jalaali (Persian) Calendar Picker Component for React Native

The package is both Android and iOS compatible.

Installation

$ yarn add react-native-persian-calendar-picker

or

$ npm install react-native-persian-calendar-picker --save

Prerequisites

CalendarPicker requires Moment JS. Date props may be anything parseable by Moment: Javascript Date, Moment date, or ISO8601 datetime string.

Usage

How to use it:

import React from 'react';
import {
  StyleSheet,
  Text,
  View,
} from 'react-native';
import PersianCalendarPicker from 'react-native-persian-calendar-picker';

class PersianCalendarPickerExample extends React.Component {
  constructor(props) {
		super(props);

    this.state = {
      selectedStartDate: null,
    };

		this.onDateChange = this.onDateChange.bind(this);
  }

  onDateChange(date) {
    this.setState({ selectedStartDate: date });
  }

  render() {
    const { selectedStartDate } = this.state;
    const startDate = selectedStartDate ? selectedStartDate.toString() : '';
    return (
      <View style={styles.container}>

        <PersianCalendarPicker
          onDateChange={this.onDateChange}
				/>

        <View>
          <Text>SELECTED DATE:{ startDate }</Text>
        </View>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#FFFFFF',
    marginTop: 100,
  },
});

PersianCalendarPicker props

Prop Type Description
isRTL Boolean Optional. Force layout to be RTL. Default is false
weekdays Array Optional. List of week days. Eg. ['Sat', 'Sun', ...] Must be 7 days
months Array Optional. List of months names. Eg. ['Farvardin', 'Ordibehesht', ...] Must be 12 months
allowRangeSelection Boolean Optional. Allow to select date ranges. Default is false
previousTitle String Optional. Title of button for previous month. Default is Previous
nextTitle String Optional. Title of button for next month. Default is Next
selectedDayColor String Optional. Color for selected day
selectedDayStyle ViewStyle Optional. Style for selected day. May override selectedDayColor.
selectedDayTextColor String Optional. Text color for selected day
selectedRangeStartStyle ViewStyle Optional. Style for range selected start day.
selectedRangeEndStyle ViewStyle Optional. Style for range selected end day.
selectedRangeStyle ViewStyle Optional. Style for all days in range selection.
disabledDates Array or Function Optional. Specifies dates that cannot be selected. Array of Dates, or a function that returns true for a given Moment date (apologies for the inverted logic).
selectedStartDate Date Optional. Specifies a selected Start Date.
selectedEndDate Date Optional. Specifies a selected End Date.
minRangeDuration Number or Array Optional. Specifies a minimum range duration when using allowRangeSelection. Can either pass a number to be used for all dates or an Array of objects if the minimum range duration depends on the date {date: Moment-parsable date, minDuration: Number
maxRangeDuration Number or Array Optional. Specifies a maximum range duration when using allowRangeSelection. Can either pass a number to be used for all dates or an Array of objects if the maximum range duration depends on the date {date: Moment-parsable date, maxDuration: Number
todayBackgroundColor String Optional. Background color for today. Default is #cccccc
todayTextStyle TextStyle Optional. Text styling for today.
textStyle Object Optional. Style overall text. Change fontFamily, color, etc.
customDatesStyles Array Optional. Style individual date(s). Array of objects {date: Moment-parseable date, containerStyle: ViewStyle, style: ViewStyle, textStyle: TextStyle}
scaleFactor Number Optional. Default (375) scales to window width
minDate Date Optional. Specifies minimum date to be selected
maxDate Date Optional. Specifies maximum date to be selected
initialDate Date Optional. Date that calendar opens to. Defaults to today.
width Number Optional. Width of CalendarPicker's container. Defaults to Dimensions width.
height Number Optional. Height of CalendarPicker's container. Defaults to Dimensions height.
swipeConfig Object Optional. Config passed to Swiper.
enableSwipe Boolean Optional. Whether to enable swiping. Default is true
enableDateChange Boolean Optional. Whether to enable pressing on day. Default is true
onDateChange Function Optional. Callback when a date is selected. Returns Moment date as first parameter.
onMonthChange Function Optional. Callback when Previous / Next month is pressed. Returns Moment date as first parameter.
onSwipe Function Optional. Callback when swipe event is triggered. Returns swipe direction as first parameter.
dayShape String Optional. Shape of the Day component. Default is circle. Available options are circle and square.
headingLevel Number Optional. Sets the aria-level for the calendar title heading when on Web. Default is 1.

Styles

Some styles will overwrite some won't. For instance:

  • If you provide textStyle with fontFamily and color, out of ranges dates will not apply your color, just fontFamily.

Order of precedence:

  • defaultColor => textStyle => selectedDayColor
  • defaultTodayBackgroundColor => todayBackgroundColor
  • defaultBackgroundColor => selectedDayColor
  • defaultTextStyles => textStyle => selectedDayTextColor

Suggestions?

Open Issues. Submit PRs.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].