GithubHelp home page GithubHelp logo

isluftmensch / react-native-week-view Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hoangnm/react-native-week-view

0.0 0.0 0.0 3.6 MB

Week View Component for react-native

JavaScript 62.13% Java 15.74% Objective-C 11.13% Starlark 1.53% Ruby 9.48%

react-native-week-view's Introduction

react-native-week-view

weekView

Props

  • events (Array) - Events to display
  • onEventPress (Function) - Callback when event item is clicked
  • numberOfDays (Number) - Set number of days to show in view, can be 1, 3, 5, 7.
  • formatDateHeader (String) - Format for dates of header, default is MMM D
  • selectedDate (Date) - Intial date to show week/days in view
  • onSwipeNext (Function) - Callback when calendar is swiped to next week/days
  • onSwipePrev (Function) - Callback when calendar is swiped to previous week/days
  • locale (String) - locale for the header, there's a addLocale function to add cusomized locale. Default is en.
  • headerStyle (Object) - custom styles for header container. Example: { backgroundColor: '#4286f4', color: '#fff', borderColor: '#fff' }
  • hoursInDisplay (Number) - Amount of hours to display in the screen. Default is 6.
  • startHour (Number) Hour to scroll to on start. Default is 8 (8 am).
  • onGridClick (Function) - Callback when the grid view is clicked. (event, startHour) => {}

Event Object

{
  id: 1,
  description: 'Event',
  startDate: new Date(),
  endDate: new Date(),
  color: 'blue',
}

Locales customization

There's a addLocale function to add customized locale for the component. The component depends on momentjs, you can refer to https://momentjs.com/docs/#/customization/ for more information.

Example:

export WeekView, { addLocale } from 'react-native-week-view';
// add customized localed before using locale prop.
addLocale('fr', {
  months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
  monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
  weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
});

TODO

  • allow to swipe between weeks or days.
  • header should be swipeable with columns.
  • allow to click on grid view.
  • allow to drag drop events to specific time and date.

react-native-week-view's People

Contributors

hoangnm avatar dependabot[bot] avatar redpicsel avatar pdpino avatar gomjellie avatar the-codepunker avatar rmariscal13 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.