#89 added cosmetics to fallout list of dates

parent 2c79ffcc
...@@ -22,7 +22,7 @@ import CalendarMonthIcon from '@mui/icons-material/CalendarMonth'; ...@@ -22,7 +22,7 @@ import CalendarMonthIcon from '@mui/icons-material/CalendarMonth';
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'; import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp'; import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
const weekDays = ["Пн","Вт","Ср","Чт","Пт","Сб","Вс" ];
const TableRowTask= ({ const TableRowTask= ({
user, user,
...@@ -51,6 +51,10 @@ const TableRowTask= ({ ...@@ -51,6 +51,10 @@ const TableRowTask= ({
const timeTransform = (dateIso)=>{ const timeTransform = (dateIso)=>{
return moment.utc(dateIso).format("HH:"+"00"); return moment.utc(dateIso).format("HH:"+"00");
} }
const getDayOfWeek = (dateIso) => {
const date = new Date(dateIso);
return weekDays[date.getDay()];
}
return ( return (
<> <>
...@@ -301,8 +305,8 @@ const TableRowTask= ({ ...@@ -301,8 +305,8 @@ const TableRowTask= ({
<Table size="small" aria-label="purchases"> <Table size="small" aria-label="purchases">
<TableHead> <TableHead>
<TableRow> <TableRow>
<TableCell colSpan={10} >Дата создания события</TableCell> <TableCell colSpan={10} >Дата создания</TableCell>
<TableCell align="right">дд-мм-гг</TableCell> <TableCell align="right">День недели</TableCell>
<TableCell align="right">Начало</TableCell> <TableCell align="right">Начало</TableCell>
<TableCell align="center" colSpan={1}>Окончание</TableCell> <TableCell align="center" colSpan={1}>Окончание</TableCell>
</TableRow> </TableRow>
...@@ -311,10 +315,14 @@ const TableRowTask= ({ ...@@ -311,10 +315,14 @@ const TableRowTask= ({
{task.dateTimeTasks.map((dateTimeTask, index) => ( {task.dateTimeTasks.map((dateTimeTask, index) => (
<TableRow key={index}> <TableRow key={index}>
<TableCell component="th" scope="row" colSpan={10}> <TableCell component="th" scope="row" colSpan={10}>
{dateTimeTransform(dateTimeTask.createdAt)} {moment(task.createdAt)
.utc()
.format("DD/MM")}
</TableCell> </TableCell>
<TableCell align="right"> <TableCell align="right">
{dateTransform(dateTimeTask.dateTimeStart)} {getDayOfWeek(dateTimeTask.dateTimeStart)}, {moment(dateTimeTask.dateTimeStart)
.utc()
.format("DD/MM")}
</TableCell> </TableCell>
<TableCell align="right"> <TableCell align="right">
{timeTransform(dateTimeTask.dateTimeStart)} {timeTransform(dateTimeTask.dateTimeStart)}
......
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