From e4da49b215f14559af6eaf736196e15fc5d3495c Mon Sep 17 00:00:00 2001 From: ekzyis Date: Thu, 5 Sep 2024 23:12:34 +0200 Subject: [PATCH] Set min date --- server/router/pages/index.templ | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/router/pages/index.templ b/server/router/pages/index.templ index b5c4e99..f9f9a47 100644 --- a/server/router/pages/index.templ +++ b/server/router/pages/index.templ @@ -6,6 +6,7 @@ import ( "git.ekzyis.com/ekzyis/delphi.market/server/router/pages/components" "git.ekzyis.com/ekzyis/delphi.market/types" "github.com/dustin/go-humanize" + "time" ) templ Index(markets []types.Market) { @@ -74,6 +75,7 @@ templ Index(markets []types.Market) { class="my-1 p-1 text-black" autocomplete="off" required + min={ minDate() } /> @@ -86,6 +88,10 @@ templ Index(markets []types.Market) { } +func minDate() string { + return time.Now().Add(24 * time.Hour).Format("2006-01-02") +} + func tabStyle(path string, tab string) string { class := "!no-underline" if path == tab {