changesV2

This commit is contained in:
wrzesinski-hubert 2020-06-07 16:31:35 +02:00
parent 404361b97a
commit 25422bff3a
2 changed files with 15 additions and 8 deletions

View File

@ -35,10 +35,7 @@ function App() {
/> />
<div className="wraper"> <div className="wraper">
<div className="wraper__calendar"> <div className="wraper__calendar">
<Schedule <Schedule data={appointments} />
data={appointments}
currentDate={new Date("2020-06-01")}
></Schedule>
</div> </div>
<div className="wraper__rightbar"> <div className="wraper__rightbar">
<RightBar /> <RightBar />

View File

@ -15,10 +15,10 @@ import { makeStyles, Theme, createStyles } from "@material-ui/core/styles";
interface CalendarProps { interface CalendarProps {
data: Array<AppointmentModel>; data: Array<AppointmentModel>;
currentDate: Date;
} }
interface CalendarState {} interface CalendarState {currentDate: Date;}
const formatDayScaleDate = ( const formatDayScaleDate = (
date: moment.MomentInput, date: moment.MomentInput,
@ -40,7 +40,7 @@ const useStyles = makeStyles((theme: Theme) =>
borderCollapse: "separate", borderCollapse: "separate",
}, },
timeTableCell: { timeTableCell: {
borderRadius: 15, //borderRadius: 15,
}, },
appointmentLayer: { appointmentLayer: {
borderRadius: 15, borderRadius: 15,
@ -95,8 +95,18 @@ export default class Calendar extends React.PureComponent<
CalendarState CalendarState
> { > {
constructor(props: CalendarProps) {
super(props);
this.state = {
currentDate: new Date("2020-06-01"),
};
}
render() { render() {
const { data, currentDate } = this.props; const { data } = this.props;
const { currentDate } = this.state;
return ( return (
<Scheduler data={data} locale={"PL-PL"} firstDayOfWeek={1}> <Scheduler data={data} locale={"PL-PL"} firstDayOfWeek={1}>