Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 committed May 29, 2024
1 parent 966e3f1 commit bbe11f2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/board/calendar/calendar.table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ const CalendarTable = ({ calendars }) => {
<Table.Body>
{calendars.map((calendar) => {
const isDisabled = moment().isAfter(moment(calendar.event_date));
const dDay = moment(calendar.event_date).diff(moment(), 'days');
const dDay = moment(calendar.event_date).diff(
moment().format('YYYY-MM-DD'),
'days',
);

return (
<Link
Expand All @@ -37,7 +40,9 @@ const CalendarTable = ({ calendars }) => {
)}
</Table.Cell>
<Table.Cell>{calendar.event_date}</Table.Cell>
<Table.Cell>{dDay ? `D-${dDay}` : 'D-Day'}</Table.Cell>
<Table.Cell>
{dDay > 0 ? `D-${dDay}` : dDay < 0 ? `D+${-dDay}` : 'D-Day'}
</Table.Cell>
</Table.Row>
</Link>
);
Expand Down

0 comments on commit bbe11f2

Please sign in to comment.