{"record":{"id":"d99caaccf12a0cf7","repo":"mattermost-community/focalboard","slug":"invalid-date-property","errorCode":null,"errorMessage":"invalid date property","messagePattern":"invalid date property","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/model/properties.go","lineNumber":22,"sourceCode":"//go:generate mockgen -destination=mocks/propValueResolverMock.go -package mocks . PropValueResolver\n\npackage model\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/mattermost/focalboard/server/utils\"\n)\n\nvar ErrInvalidBoardBlock = errors.New(\"invalid board block\")\nvar ErrInvalidPropSchema = errors.New(\"invalid property schema\")\nvar ErrInvalidProperty = errors.New(\"invalid property\")\nvar ErrInvalidPropertyValue = errors.New(\"invalid property value\")\nvar ErrInvalidPropertyValueType = errors.New(\"invalid property value type\")\nvar ErrInvalidDate = errors.New(\"invalid date property\")\n\n// PropValueResolver allows PropDef.GetValue to further decode property values, such as\n// looking up usernames from ids.\ntype PropValueResolver interface {\n\tGetUserByID(userID string) (*User, error)\n}\n\n// BlockProperties is a map of Prop's keyed by property id.\ntype BlockProperties map[string]BlockProp\n\n// BlockProp represent a property attached to a block (typically a card).\ntype BlockProp struct {\n\tID    string `json:\"id\"`\n\tIndex int    `json:\"index\"`\n\tName  string `json:\"name\"`\n\tValue string `json:\"value\"`\n}\n","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/mattermost-community/focalboard/blob/a84bbb65e32edf972856b329417096ac413518e9/server/model/properties.go#L4-L40","documentation":"ErrInvalidDate indicates a date property value cannot be parsed into the expected date format. ParseDate returns it when the stored string is not a valid date representation (Focalboard uses serialized date objects/timestamps). It prevents invalid dates from propagating into calendar views and reminders.","triggerScenarios":"Calling ParseDate on a date property value string that is empty, non-numeric, or otherwise not in the expected serialized date format.","commonSituations":"Cards imported from other tools storing dates as human-readable strings, manual DB edits, or clients writing dates in a different format/version than the parser expects.","solutions":["Rewrite the date property value in the format Focalboard expects (serialized date object with a valid timestamp).","Clear the invalid date value from the card and re-enter it via the UI.","If importing, convert external date formats to Focalboard's serialized form before import.","Guard with errors.Is(err, model.ErrInvalidDate) and fall back to treating the card as undated."],"exampleFix":"// before\nprops[\"due\"] = \"tomorrow\"\n// after\nprops[\"due\"] = fmt.Sprintf(`{\"from\":%d,\"to\":%d}`, ts, ts) // epoch millis","handlingStrategy":"try-catch","validationCode":"func validDateProp(raw string) bool {\n    var d struct{ From int64 `json:\"from\"` }\n    return json.Unmarshal([]byte(raw), &d) == nil && d.From > 0\n}","typeGuard":"func isSerializedDate(raw string) bool {\n    var d map[string]int64\n    return json.Unmarshal([]byte(raw), &d) == nil\n}","tryCatchPattern":"date, err := model.ParseDate(raw)\nif errors.Is(err, model.ErrInvalidDate) {\n    date = nil // treat card as undated\n}","preventionTips":["Always write date properties as Focalboard's serialized date object.","Convert external date formats during import.","Never store free-text dates in date-typed properties."],"tags":["go","date","parsing"],"backgroundTag":"invalid-date-format","analyzedSha":"a84bbb65e32edf972856b329417096ac413518e9","analyzedAt":"2026-08-30T09:22:20.720Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}