Commit 312070bd authored by Ermolaev Timur's avatar Ermolaev Timur

#38 Получилось отрисовать логику для двух часов

parent ce84932b
......@@ -98,7 +98,7 @@ const CalendarTask = ({year, month, tasks, day, hours, setCurrentTask, hourForma
{tasksCell.length ? tasksCell.map((task, i)=>
{
if (task.infoForCell.endHour > hour && task.infoForCell.startHour === hour && hourFormat) {
if (hourFormat && task.infoForCell.endHour > hour && task.infoForCell.startHour === hour || (!hourFormat && task.infoForCell.endHour > hour + 1 && task.infoForCell.startHour === hour)) {
return (
<TaskWithNoStartAndAllEnd
key={task.id}
......@@ -107,7 +107,7 @@ const CalendarTask = ({year, month, tasks, day, hours, setCurrentTask, hourForma
/>
)
}
if (task.infoForCell.startHour < hour && task.infoForCell.endHour > hour) {
if (hourFormat && task.infoForCell.startHour < hour && task.infoForCell.endHour > hour || ((!hourFormat && task.infoForCell.startHour < hour && task.infoForCell.endHour > hour + 2))) {
return (
<TaskWithAllStartAndAllEnd
key={task.id}
......@@ -116,7 +116,7 @@ const CalendarTask = ({year, month, tasks, day, hours, setCurrentTask, hourForma
/>
)
}
if (task.infoForCell.endMinute === 59 && task.infoForCell.startHour < hour) {
if (hourFormat && task.infoForCell.endMinute === 59 && task.infoForCell.startHour < hour || (!hourFormat && task.infoForCell.endMinute === 59 && task.infoForCell.startHour < hour && (task.infoForCell.endHour === hour || task.infoForCell.endHour === hour + 1 && task.infoForCell.startHour + 1 !== hour))) {
return (
<TaskWithAllStartAndNoEnd
key={task.id}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment