feat(12.2-02): add the datepicker field with server-side bounds and date list columns

- type: datepicker compiles the D-20 keys; format maps to displayFormat with WinterCMS's momentFormat table
- boot fails when the mode does not match the column's Go type (time.Time, lagoon.Date, lagoon.TimeOfDay)
- datepicker is a writable scalar field; minDate and maxDate are rechecked on save
- columns.yaml accepts type: date and type: time; Scanner/Valuer structs are columns, not relations
- conformance fixture carries date and datetime fields; README, forms and lists docs
This commit is contained in:
Jakub Zych
2026-10-02 18:19:04 +02:00
parent bbb804961e
commit 67d4c7ff13
17 changed files with 719 additions and 32 deletions

View File

@@ -20,7 +20,7 @@ import (
const listSearchTerm = "search"
var listColumnTypes = map[string]struct{}{
"text": {}, "datetime": {}, "switch": {},
"text": {}, "datetime": {}, "switch": {}, "date": {}, "time": {},
}
type listDocument struct {
@@ -434,6 +434,11 @@ func isListRelation(t reflect.Type) bool {
if t == reflect.TypeOf(gorm.DeletedAt{}) {
return false
}
// A struct stored in one column (it scans or values itself, such as
// lagoon.Date and lagoon.TimeOfDay) is a scalar, not a relation.
if reflect.PointerTo(t).Implements(scannerType) || t.Implements(valuerType) || reflect.PointerTo(t).Implements(valuerType) {
return false
}
return true
}