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

Fix invoices pagination ordering by adding time to the dates. #857

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion dashboard/final-example/app/lib/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
26 changes: 13 additions & 13 deletions dashboard/final-example/app/lib/placeholder-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
];

Expand Down
2 changes: 1 addition & 1 deletion dashboard/final-example/app/seed/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
// );
// `;

Expand Down
26 changes: 13 additions & 13 deletions dashboard/starter-example/app/lib/placeholder-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
];

Expand Down
2 changes: 1 addition & 1 deletion dashboard/starter-example/app/seed/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
// );
// `;

Expand Down