feat: additional expenses

This commit is contained in:
2024-11-26 01:37:15 +04:00
parent e3146832a5
commit 564895c26f
18 changed files with 430 additions and 12 deletions

View File

@@ -56,4 +56,13 @@ export const strTimeToFloatHours = (time: string): number => {
const minutes = parseInt(values[1]);
return hours + minutes / 60;
}
}
export const dateToString = (date: Date | null) => {
if (date === null) return null;
const month = date.getMonth() + 1;
const day = date.getDate();
const monthStr = month < 10 ? `0${month}` : month;
const dayStr = day < 10 ? `0${day}` : day;
return `${date.getFullYear()}-${monthStr}-${dayStr}`;
};