mattermost-community/focalboard · warning

invalid date property

Error message

invalid date property

What it means

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.

Source

Thrown at server/model/properties.go:22

//go:generate mockgen -destination=mocks/propValueResolverMock.go -package mocks . PropValueResolver

package model

import (
	"encoding/json"
	"errors"
	"fmt"
	"strings"

	"github.com/mattermost/focalboard/server/utils"
)

var ErrInvalidBoardBlock = errors.New("invalid board block")
var ErrInvalidPropSchema = errors.New("invalid property schema")
var ErrInvalidProperty = errors.New("invalid property")
var ErrInvalidPropertyValue = errors.New("invalid property value")
var ErrInvalidPropertyValueType = errors.New("invalid property value type")
var ErrInvalidDate = errors.New("invalid date property")

// PropValueResolver allows PropDef.GetValue to further decode property values, such as
// looking up usernames from ids.
type PropValueResolver interface {
	GetUserByID(userID string) (*User, error)
}

// BlockProperties is a map of Prop's keyed by property id.
type BlockProperties map[string]BlockProp

// BlockProp represent a property attached to a block (typically a card).
type BlockProp struct {
	ID    string `json:"id"`
	Index int    `json:"index"`
	Name  string `json:"name"`
	Value string `json:"value"`
}

View on GitHub (pinned to a84bbb65e3)

Solutions

  1. Rewrite the date property value in the format Focalboard expects (serialized date object with a valid timestamp).
  2. Clear the invalid date value from the card and re-enter it via the UI.
  3. If importing, convert external date formats to Focalboard's serialized form before import.
  4. Guard with errors.Is(err, model.ErrInvalidDate) and fall back to treating the card as undated.

Example fix

// before
props["due"] = "tomorrow"
// after
props["due"] = fmt.Sprintf(`{"from":%d,"to":%d}`, ts, ts) // epoch millis
Defensive patterns

Strategy: try-catch

Validate before calling

func validDateProp(raw string) bool {
    var d struct{ From int64 `json:"from"` }
    return json.Unmarshal([]byte(raw), &d) == nil && d.From > 0
}

Type guard

func isSerializedDate(raw string) bool {
    var d map[string]int64
    return json.Unmarshal([]byte(raw), &d) == nil
}

Try / catch

date, err := model.ParseDate(raw)
if errors.Is(err, model.ErrInvalidDate) {
    date = nil // treat card as undated
}

Prevention

When it happens

Trigger: Calling ParseDate on a date property value string that is empty, non-numeric, or otherwise not in the expected serialized date format.

Common situations: 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.

Related errors


AI-assisted analysis of mattermost-community/focalboard@a84bbb65e3 (2026-08-30). Data as JSON: /api/errors/d99caaccf12a0cf7. Report an issue: GitHub.