Set min date

This commit is contained in:
ekzyis 2024-09-05 23:12:34 +02:00
parent 9df7ce8338
commit e4da49b215
1 changed files with 6 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"git.ekzyis.com/ekzyis/delphi.market/server/router/pages/components" "git.ekzyis.com/ekzyis/delphi.market/server/router/pages/components"
"git.ekzyis.com/ekzyis/delphi.market/types" "git.ekzyis.com/ekzyis/delphi.market/types"
"github.com/dustin/go-humanize" "github.com/dustin/go-humanize"
"time"
) )
templ Index(markets []types.Market) { templ Index(markets []types.Market) {
@ -74,6 +75,7 @@ templ Index(markets []types.Market) {
class="my-1 p-1 text-black" class="my-1 p-1 text-black"
autocomplete="off" autocomplete="off"
required required
min={ minDate() }
/> />
<button type="submit" class="mt-3">submit</button> <button type="submit" class="mt-3">submit</button>
</form> </form>
@ -86,6 +88,10 @@ templ Index(markets []types.Market) {
</html> </html>
} }
func minDate() string {
return time.Now().Add(24 * time.Hour).Format("2006-01-02")
}
func tabStyle(path string, tab string) string { func tabStyle(path string, tab string) string {
class := "!no-underline" class := "!no-underline"
if path == tab { if path == tab {