Minor bugfix to hours.update
This commit is contained in:
parent
4d6840559d
commit
c925ae8811
@ -42,10 +42,12 @@ export const daysCmd = new Command()
|
||||
|
||||
const moodStr = moodToStars(day.mood);
|
||||
const dateStr = format(day.date, "EEEE, MMMM do");
|
||||
const data: string[][] = [[dateStr, '', moodStr], [day.comment ?? "No comment", '', '']];
|
||||
const data: string[][] = [[dateStr, '', moodStr], [day.comment ?? "No comment", '', ''],
|
||||
["Time", "Category", "Comment"]
|
||||
];
|
||||
|
||||
day.hours.forEach((h) => {
|
||||
data.push([getHourFromTime(h.time), h.categoryCode ?? "--", h.comment ?? ""]);
|
||||
data.push([getHourFromTime(h.time), h.categoryName ?? "--", h.comment ?? ""]);
|
||||
})
|
||||
|
||||
console.log(table(data, {
|
||||
@ -56,7 +58,7 @@ export const daysCmd = new Command()
|
||||
return lineIndex === 0 || lineIndex === columnCount || (lineIndex === 0 && columnCount === 2);
|
||||
},
|
||||
drawHorizontalLine: (lineIndex, rowCount) => {
|
||||
return (lineIndex < 2 || lineIndex === 2 || lineIndex === rowCount);
|
||||
return (lineIndex < 1 || lineIndex === 2 || lineIndex === 3 || lineIndex === rowCount);
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
||||
@ -94,6 +94,7 @@ export const daysAppRouter = router({
|
||||
time: hours.time,
|
||||
categoryId: hours.categoryId,
|
||||
categoryCode: categories.code,
|
||||
categoryName: categories.name,
|
||||
comment: hours.comment,
|
||||
})
|
||||
.from(hours)
|
||||
|
||||
@ -50,7 +50,7 @@ export const hoursAppRouter = router({
|
||||
dateQuery: z.string(),
|
||||
time: z.number(),
|
||||
code: z.string().optional(),
|
||||
comment: z.string().nullable(),
|
||||
comment: z.string().nullable().optional(),
|
||||
}),
|
||||
)
|
||||
// .output(zHourSchema)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user