1.0.7 • Published 1 year ago

react-material-event-calendar v1.0.7

Weekly downloads
7
License
MIT
Repository
github
Last release
1 year ago

React material event calendar

codecov

Simple calendar component based on @mui

Changes in 1.0.7

  • Reduce bundle size
  • Other performance fixes

Installation

npm i react-material-event-calendar

"peerDependencies": {
 "@mui/icons-material": "^5.0.0",
  "@mui/material": "^5.0.0",
 }

Usage

import Calendar from 'react-material-event-calendar'

function App() {

//selected days will be available here
 const getSelectedDays = (days) => {
      console.log(days)
  }
  const today = new Date();
  const currentMonth = today.getMonth();
  const currentYear = today.getFullYear();
  return (
    <div className="App">
      <header className="App-header">
      <Calendar month={currentMonth} title="Calendar" selectColor={'red'} getSelectedDays={getSelectedDays} year={currentYear} selectedDays={ {'2020-5': [{ '3': { 'info': 'testing', color :'red' } }, {'8': { 'info': 'testing2' }}] }} />
      </header>
    </div>
  );
}

Options

Currently, these options can be passed to the module

PropertyDescriptionSample value
titleTitle of the componentcalendar
daysYou can pass in your custom day names as an array (By default it is english day names)'Sunday', 'Monday'...
monthInitial month(MM) that has to shown when module renders10 or 04
yearInitial year that(YYYY) has to shown when module renders2020
selectColorThe color for selected fieldred
getSelectedDayscallback function to receive date changes(dates) => {}
onMonthOrYearChangecallback function to receive month or year change(year,month) => {}
selectedDaysHere you can pass the dates which needs to be shown as preselected, info refers to tool tip to be shown and color refers to background color( default is blue).{'2020-5': { '3': { 'info': 'testing', color :'red' } }}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

0.3.2

3 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago