Skip to content

Commit

Permalink
Pre-fill date field for convenience
Browse files Browse the repository at this point in the history
  • Loading branch information
julwrites committed Sep 10, 2024
1 parent 924391f commit f207096
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

docker-compose down

docker rmi cash-register-cash-register

docker-compose up -d
5 changes: 4 additions & 1 deletion pages/components/ExpenseForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ const emits = defineEmits<{
(event: 'cancel'): void;
}>();
const expenseData = ref<Expense>({ ...props.expense });
const expenseData = ref<Expense>({
...props.expense,
date: props.expense.date || new Date().toISOString().split('T')[0]
});
const categories = ref<string[]>(props.categories);
Expand Down
4 changes: 2 additions & 2 deletions pages/expense-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const newExpense = ref<Expense>({
credit: 0,
debit: 0,
description: '',
date: '',
date: new Date().toISOString().split('T')[0],
category: '',
});
Expand Down Expand Up @@ -48,7 +48,7 @@ async function addExpense(expense: Expense) {
credit: 0,
debit: 0,
description: '',
date: '',
date: new Date().toISOString().split('T')[0],
category: ''
};
Expand Down

0 comments on commit f207096

Please sign in to comment.