Skip to content

Commit

Permalink
vinvoor: highlight mondays
Browse files Browse the repository at this point in the history
  • Loading branch information
Topvennie committed Aug 22, 2024
1 parent 761c2c2 commit b683803
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions vingo/handlers/days.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
type Days struct{}

type DaysBody struct {
StartDate time.Time `json:"startDate"`
EndDate time.Time `json:"endDate"`
StartDate time.Time `json:"start_date"`
EndDate time.Time `json:"end_date"`
}

func (Days) CreateMultiple(c *fiber.Ctx) error {
Expand Down
4 changes: 2 additions & 2 deletions vinvoor/src/settings/admin/days/DaysAdd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export const DaysAdd: FC<DaysAddProps> = ({ reloadDays }) => {
}

postApi("admin/days", {
startDate: startDate.toISOString(),
endDate: endDate.toISOString(),
start_date: startDate.format("YYYY-MM-DDTHH:mm:ssZ"),
end_date: endDate.format("YYYY-MM-DDTHH:mm:ssZ"),
})
.then(() => {
enqueueSnackbar("successfully saved days", {
Expand Down
10 changes: 9 additions & 1 deletion vinvoor/src/settings/admin/days/DaysTableBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ export const DaysTableBody: FC<DaysTableBodyProps> = ({
return (
<TableBody>
{rows.map(day => (
<TableRow key={day.id} selected={isSelected(day.id)}>
<TableRow
key={day.id}
selected={isSelected(day.id)}
sx={{
...(day.date.getDay() === 1 && {
backgroundColor: theme => theme.palette.action.hover,
}),
}}
>
<TableCell padding="checkbox" onClick={() => handleSelect(day.id)}>
<Checkbox checked={isSelected(day.id)} />
</TableCell>
Expand Down

0 comments on commit b683803

Please sign in to comment.