From 33a011d7237d01f6c8c6ee57bc2c1eddd126ff2c Mon Sep 17 00:00:00 2001 From: relaxed <> Date: Wed, 28 Aug 2024 19:13:43 +0500 Subject: [PATCH] request date fix --- src/App.svelte | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 86799cc..af0b382 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -76,11 +76,16 @@ } function get_rasp() { - const startDate = `${start_date.getDate()}.${start_date.getMonth() + 1}.${start_date.getFullYear()}`; + const s_date = start_date.getDate(); + const s_month = start_date.getMonth() + 1; + const startDate = `${s_date < 10 ? 0 : ""}${s_date}.${s_month < 10 ? 0 : ""}${s_month}.${start_date.getFullYear()}`; end_date = new Date(start_date); end_date.setDate(start_date.getDate() + 6); end_date.setHours(23, 59, 59, 999); - const endDate = `${end_date.getDate()}.${end_date.getMonth() + 1}.${end_date.getFullYear()}`; + + const e_date = end_date.getDate(); + const e_month = end_date.getMonth() + 1; + const endDate = `${e_date < 10 ? 0 : ""}${e_date}.${e_month < 10 ? 0 : ""}${e_month}.${end_date.getFullYear()}`; const date_full = `${startDate}-${endDate}`; @@ -208,7 +213,7 @@ class="p-2 flex justify-between items-center {i === data.saved.length - 1 ? '' : 'border-b-2'} - border-[var(--w-border)] dark:border-[var(--b-border)]" + border-[var(--w-border)] dark:border-[var(--b-border)]" >
{info.name}
@@ -232,8 +237,8 @@