#89 fix hour round up

parent 2c6f4ba7
...@@ -41,15 +41,23 @@ const TableRowTask= ({ ...@@ -41,15 +41,23 @@ const TableRowTask= ({
const [open, setOpen] = React.useState(false); const [open, setOpen] = React.useState(false);
const roudHourUp =(dateIso)=>{
let m = moment(dateIso);
let roundUp = m.minute() || m.second() || m.millisecond() ? m.add(1, 'hour').startOf('hour') : m.startOf('hour');
return roundUp
}
const timeTransform = (dateIso)=>{ const timeTransform = (dateIso)=>{
return moment.utc(dateIso).format("HH:"+"00"); const exp = roudHourUp(moment.utc(dateIso)).format("HH:"+"00")
return exp;
} }
const getDayOfWeek = (dateIso) => { const getDayOfWeek = (dateIso) => {
const date = moment.utc(dateIso); const date = moment.utc(dateIso);
return weekDays[date.day()]; return weekDays[date.day()];
} }
return ( return (
<> <>
<TableRow hover key={task.id}> <TableRow hover 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