Set min date
This commit is contained in:
parent
9df7ce8338
commit
e4da49b215
|
@ -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() }
|
||||
/>
|
||||
<button type="submit" class="mt-3">submit</button>
|
||||
</form>
|
||||
|
@ -86,6 +88,10 @@ templ Index(markets []types.Market) {
|
|||
</html>
|
||||
}
|
||||
|
||||
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 {
|
||||
|
|
Loading…
Reference in New Issue