Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vinvoor: highlight mondays #51

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading