diff --git a/dashboard/final-example/app/lib/actions.ts b/dashboard/final-example/app/lib/actions.ts index 2a6355b9..c6de0fb8 100644 --- a/dashboard/final-example/app/lib/actions.ts +++ b/dashboard/final-example/app/lib/actions.ts @@ -52,7 +52,7 @@ export async function createInvoice(prevState: State, formData: FormData) { // Prepare data for insertion into the database const { customerId, amount, status } = validatedFields.data; const amountInCents = amount * 100; - const date = new Date().toISOString().split('T')[0]; + const date = new Date().toISOString().replace('T', ' ').slice(0, 19); // Insert data into the database try { diff --git a/dashboard/final-example/app/lib/placeholder-data.ts b/dashboard/final-example/app/lib/placeholder-data.ts index 257fb14a..c05a4431 100644 --- a/dashboard/final-example/app/lib/placeholder-data.ts +++ b/dashboard/final-example/app/lib/placeholder-data.ts @@ -53,79 +53,79 @@ const invoices = [ customer_id: customers[0].id, amount: 15795, status: 'pending', - date: '2022-12-06', + date: '2022-12-06 15:19:18', }, { customer_id: customers[1].id, amount: 20348, status: 'pending', - date: '2022-11-14', + date: '2022-11-14 16:30:58', }, { customer_id: customers[4].id, amount: 3040, status: 'paid', - date: '2022-10-29', + date: '2022-10-29 14:45:12', }, { customer_id: customers[3].id, amount: 44800, status: 'paid', - date: '2023-09-10', + date: '2023-09-10 19:20:34', }, { customer_id: customers[5].id, amount: 34577, status: 'pending', - date: '2023-08-05', + date: '2023-08-05 13:50:23', }, { customer_id: customers[2].id, amount: 54246, status: 'pending', - date: '2023-07-16', + date: '2023-07-16 17:51:06', }, { customer_id: customers[0].id, amount: 666, status: 'pending', - date: '2023-06-27', + date: '2023-06-27 19:32:17', }, { customer_id: customers[3].id, amount: 32545, status: 'paid', - date: '2023-06-09', + date: '2023-06-09 16:04:15', }, { customer_id: customers[4].id, amount: 1250, status: 'paid', - date: '2023-06-17', + date: '2023-06-17 16:50:06', }, { customer_id: customers[5].id, amount: 8546, status: 'paid', - date: '2023-06-07', + date: '2023-06-07 15:41:27', }, { customer_id: customers[1].id, amount: 500, status: 'paid', - date: '2023-08-19', + date: '2023-08-19 19:06:28', }, { customer_id: customers[5].id, amount: 8945, status: 'paid', - date: '2023-06-03', + date: '2023-06-03 14:16:48', }, { customer_id: customers[2].id, amount: 1000, status: 'paid', - date: '2022-06-05', + date: '2022-06-05 17:14:35', }, ]; diff --git a/dashboard/final-example/app/seed/route.ts b/dashboard/final-example/app/seed/route.ts index ce31c7af..aa20e13d 100644 --- a/dashboard/final-example/app/seed/route.ts +++ b/dashboard/final-example/app/seed/route.ts @@ -38,7 +38,7 @@ // customer_id UUID NOT NULL, // amount INT NOT NULL, // status VARCHAR(255) NOT NULL, -// date DATE NOT NULL +// date TIMESTAMP NOT NULL // ); // `; diff --git a/dashboard/starter-example/app/lib/placeholder-data.ts b/dashboard/starter-example/app/lib/placeholder-data.ts index 257fb14a..c05a4431 100644 --- a/dashboard/starter-example/app/lib/placeholder-data.ts +++ b/dashboard/starter-example/app/lib/placeholder-data.ts @@ -53,79 +53,79 @@ const invoices = [ customer_id: customers[0].id, amount: 15795, status: 'pending', - date: '2022-12-06', + date: '2022-12-06 15:19:18', }, { customer_id: customers[1].id, amount: 20348, status: 'pending', - date: '2022-11-14', + date: '2022-11-14 16:30:58', }, { customer_id: customers[4].id, amount: 3040, status: 'paid', - date: '2022-10-29', + date: '2022-10-29 14:45:12', }, { customer_id: customers[3].id, amount: 44800, status: 'paid', - date: '2023-09-10', + date: '2023-09-10 19:20:34', }, { customer_id: customers[5].id, amount: 34577, status: 'pending', - date: '2023-08-05', + date: '2023-08-05 13:50:23', }, { customer_id: customers[2].id, amount: 54246, status: 'pending', - date: '2023-07-16', + date: '2023-07-16 17:51:06', }, { customer_id: customers[0].id, amount: 666, status: 'pending', - date: '2023-06-27', + date: '2023-06-27 19:32:17', }, { customer_id: customers[3].id, amount: 32545, status: 'paid', - date: '2023-06-09', + date: '2023-06-09 16:04:15', }, { customer_id: customers[4].id, amount: 1250, status: 'paid', - date: '2023-06-17', + date: '2023-06-17 16:50:06', }, { customer_id: customers[5].id, amount: 8546, status: 'paid', - date: '2023-06-07', + date: '2023-06-07 15:41:27', }, { customer_id: customers[1].id, amount: 500, status: 'paid', - date: '2023-08-19', + date: '2023-08-19 19:06:28', }, { customer_id: customers[5].id, amount: 8945, status: 'paid', - date: '2023-06-03', + date: '2023-06-03 14:16:48', }, { customer_id: customers[2].id, amount: 1000, status: 'paid', - date: '2022-06-05', + date: '2022-06-05 17:14:35', }, ]; diff --git a/dashboard/starter-example/app/seed/route.ts b/dashboard/starter-example/app/seed/route.ts index ce31c7af..aa20e13d 100644 --- a/dashboard/starter-example/app/seed/route.ts +++ b/dashboard/starter-example/app/seed/route.ts @@ -38,7 +38,7 @@ // customer_id UUID NOT NULL, // amount INT NOT NULL, // status VARCHAR(255) NOT NULL, -// date DATE NOT NULL +// date TIMESTAMP NOT NULL // ); // `;