From b6044a7d4a1881a677169d0cfe61a3b9a9498b35 Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Fri, 2 Feb 2024 02:59:41 +0100 Subject: [PATCH] Advance min dates of departure and arrival one day MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apparently, expecting people to book at least one day in advance is being “too optimistic”. --- pkg/template/render.go | 6 +++--- web/templates/public/booking.gohtml | 4 ++-- web/templates/public/campsite/type.gohtml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/template/render.go b/pkg/template/render.go index a8d6b41..9cef89e 100644 --- a/pkg/template/render.go +++ b/pkg/template/render.go @@ -107,12 +107,12 @@ func mustRenderLayout(w io.Writer, user *auth.User, company *auth.Company, templ "formatDate": func(time time.Time) template.HTML { return template.HTML(`") }, + "today": func() string { + return time.Now().Format(database.ISODateFormat) + }, "tomorrow": func() string { return time.Now().AddDate(0, 0, 1).Format(database.ISODateFormat) }, - "overmorrow": func() string { - return time.Now().AddDate(0, 0, 2).Format(database.ISODateFormat) - }, "queryEscape": func(s string) string { return url.QueryEscape(s) }, diff --git a/web/templates/public/booking.gohtml b/web/templates/public/booking.gohtml index 71fa0be..1a9cebe 100644 --- a/web/templates/public/booking.gohtml +++ b/web/templates/public/booking.gohtml @@ -128,7 +128,7 @@ @@ -138,7 +138,7 @@ diff --git a/web/templates/public/campsite/type.gohtml b/web/templates/public/campsite/type.gohtml index 19fa605..6753eff 100644 --- a/web/templates/public/campsite/type.gohtml +++ b/web/templates/public/campsite/type.gohtml @@ -40,13 +40,13 @@