File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
apps/client/src/widgets/attribute_widgets Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import "./PromotedAttributesDisplay.css";
44import { useTriliumEvent } from "../react/hooks" ;
55import attributes from "../../services/attributes" ;
66import { DefinitionObject } from "../../services/promoted_attribute_definition_parser" ;
7+ import { formatDateTime } from "../../utils/formatters" ;
78
89interface PromotedAttributesDisplayProps {
910 note : FNote ;
@@ -57,6 +58,12 @@ function formatLabelValue(attr: AttributeWithDefinitions): string {
5758 } else {
5859 return numberValue . toString ( ) ;
5960 }
61+ case "date" :
62+ case "datetime" :
63+ const date = new Date ( value ) ;
64+ if ( isNaN ( date . getTime ( ) ) ) return value ;
65+ const timeFormat = attr . def . labelType === "datetime" ? "short" : "none" ;
66+ return formatDateTime ( date , "short" , timeFormat ) ;
6067 case "text" :
6168 default :
6269 return value ;
You can’t perform that action at this time.
0 commit comments