{"record":{"id":"a43dc7d60f324ee9","repo":"siyuan-note/siyuan","slug":"new-item-template-field-s-current-time-value-is","errorCode":null,"errorMessage":"new item template field [%s] current time value is invalid","messagePattern":"new item template field \\[(.+?)\\] current time value is invalid","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/attribute_view_new_item.go","lineNumber":530,"sourceCode":"func newItemTitleFromPath(renderedPath string) string {\n\tif \"\" == renderedPath || strings.HasSuffix(renderedPath, \"/\") {\n\t\treturn \"\"\n\t}\n\treturn normalizeDocTitle(path.Base(renderedPath))\n}\n\nfunc resolveNewItemFieldValues(attrView *av.AttributeView, itemTemplate *av.NewItemTemplate, createdAt time.Time) (ret map[string]*av.Value, err error) {\n\tret = map[string]*av.Value{}\n\tfor keyID, fieldValue := range itemTemplate.FieldValues {\n\t\tkey, getErr := attrView.GetKey(keyID)\n\t\tif nil != getErr || nil == key {\n\t\t\treturn nil, fmt.Errorf(\"new item template field [%s] not found\", keyID)\n\t\t}\n\t\tvar value *av.Value\n\t\tswitch fieldValue.Mode {\n\t\tcase av.NewItemFieldValueCurrentTime:\n\t\t\tif av.KeyTypeDate != key.Type {\n\t\t\t\treturn nil, fmt.Errorf(\"new item template field [%s] current time value is invalid\", keyID)\n\t\t\t}\n\t\t\tisNotTime := true\n\t\t\tif nil != key.Date {\n\t\t\t\tisNotTime = !key.Date.FillSpecificTime\n\t\t\t}\n\t\t\tvalue = &av.Value{Type: av.KeyTypeDate, Date: av.NewFormattedValueDate(createdAt.UnixMilli(), 0, av.DateFormatNone, isNotTime, false)}\n\t\tcase av.NewItemFieldValueStatic:\n\t\t\tif nil == fieldValue.Value || fieldValue.Value.Type != key.Type {\n\t\t\t\treturn nil, fmt.Errorf(\"new item template field [%s] value is invalid\", keyID)\n\t\t\t}\n\t\t\tvalue = fieldValue.Value.Clone()\n\t\t\tif av.KeyTypeRelation == key.Type {\n\t\t\t\tfilterNewItemTemplateRelationValue(attrView, key, value)\n\t\t\t\tif nil == value.Relation || 0 == len(value.Relation.BlockIDs) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:","sourceCodeStart":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/attribute_view_new_item.go#L512-L548","documentation":"Error \"new item template field [%s] current time value is invalid\" thrown in siyuan-note/siyuan.","triggerScenarios":"A new-item template sets a 'current time' value on a field whose column type is not date.","commonSituations":"Occurs when a template field configured with current-time mode has a stored value that cannot be parsed as a date.","solutions":["Use the 'current time' value mode only on date-type fields.","Change the field to date type or choose a fixed value mode."],"exampleFix":"Edit the template field: set the column type to Date, or replace the current-time mode with a static value.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}