diff --git a/README.md b/README.md index 3675074..0d2a239 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ --- React mui scheduler is a react component based on @mui v5 that allows you to manage data in a calendar. - +
## 🚀 Installation ```nodejs @@ -32,7 +32,7 @@ function App() { const [state] = useState({ options: { transitionMode: "zoom", // or fade - startWeekOn: "Mon", // or Sun + startWeekOn: "mon", // or sun defaultMode: "month", // or week | day | timeline minWidth: 540, maxWidth: 540, @@ -64,7 +64,7 @@ function App() { color: "#f28f6a", startHour: "04:00 AM", endHour: "05:00 AM", - date: "2021-09-28", + date: "2022-05-05", createdAt: new Date(), createdBy: "Kristina Mayer" }, @@ -76,7 +76,7 @@ function App() { color: "#099ce5", startHour: "09:00 AM", endHour: "10:00 AM", - date: "2021-09-29", + date: "2022-05-09", createdAt: new Date(), createdBy: "Kristina Mayer" }, @@ -88,7 +88,7 @@ function App() { color: "#263686", startHour: "13 PM", endHour: "14 PM", - date: "2021-09-30", + date: "2022-05-10", createdAt: new Date(), createdBy: "Kristina Mayer" }, @@ -100,7 +100,7 @@ function App() { color: "#f28f6a", startHour: "08:00 AM", endHour: "09:00 AM", - date: "2021-10-01", + date: "2022-05-11", createdAt: new Date(), createdBy: "Kristina Mayer" } diff --git a/package.json b/package.json index ff63860..b1bb19c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-mui-scheduler", - "version": "2.0.1", + "version": "2.0.2", "description": "📅 React mui scheduler is a react component based on @mui v5 that allows you to manage data in a calendar", "main": "dist/index.esm.js", "scripts": { diff --git a/src/EventItem.jsx b/src/EventItem.jsx index db18458..aa5ac1a 100644 --- a/src/EventItem.jsx +++ b/src/EventItem.jsx @@ -40,7 +40,10 @@ EventItem.propTypes = { sx: PropTypes.object, boxSx: PropTypes.object, event: PropTypes.object.isRequired, - rowId: PropTypes.number, + rowId: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.number + ]), isMonthMode: PropTypes.bool, onClick: PropTypes.func, handleTaskClick: PropTypes.func, diff --git a/src/MonthModeView.jsx b/src/MonthModeView.jsx index 5bec18f..bf70b0b 100644 --- a/src/MonthModeView.jsx +++ b/src/MonthModeView.jsx @@ -1,10 +1,10 @@ import React, {useState, useContext} from 'react' import PropTypes from 'prop-types' -import { format } from 'date-fns' +import {format, getDay} from 'date-fns' import {useTheme, styled, alpha} from '@mui/material/styles' import { Paper, Typography, Table, TableBody, TableCell, TableContainer, - TableHead, TableRow, tableCellClasses + TableHead, TableRow, tableCellClasses, Box } from "@mui/material" import { getDaysInMonth, isSameMonth } from 'date-fns' import EventNoteRoundedIcon from '@mui/icons-material/EventNoteRounded' @@ -63,13 +63,14 @@ function MonthModeView (props) { const { t } = useTranslation(['common']) const today = new Date() let currentDaySx = { + width: 24, + height: 22, + margin: 'auto', display: 'block', - background: alpha(theme.palette.primary.main, 1), + paddingTop: '2px', borderRadius: '50%', - padding: '1px 3px', - color: '#fff', - width: 'fit-content', - margin: 'auto' + //padding: '1px 7px', + //width: 'fit-content' } const onCellDragOver = (e) => { @@ -235,36 +236,49 @@ function MonthModeView (props) { } }} > - {row?.days?.map((day, indexD) => ( -