@@ -67,6 +67,24 @@ type DropdownOption = {
6767
6868const MAX_DESCRIPTION_LENGTH = 120 ;
6969
70+ const formatCreatedOn = (createdOnValue : string | Date ) => {
71+ const rawValue =
72+ createdOnValue instanceof Date
73+ ? createdOnValue .toISOString ()
74+ : createdOnValue ;
75+ const dateLabel = formatDateString (rawValue );
76+ const date = new Date (rawValue );
77+ if (Number .isNaN (date .getTime ())) {
78+ return ` Created on ${dateLabel } ` ;
79+ }
80+ const timeLabel = date .toLocaleTimeString (" en-US" , {
81+ hour: " numeric" ,
82+ minute: " 2-digit" ,
83+ hour12: true ,
84+ });
85+ return ` Created on ${dateLabel }, ${timeLabel } ` ;
86+ };
87+
7088const dropdownOptions = computed <DropdownOption []>(() =>
7189 itemVersions .value
7290 .filter (
@@ -77,13 +95,7 @@ const dropdownOptions = computed<DropdownOption[]>(() =>
7795 const title = version .title ?? " Untitled" ;
7896 const author = version .author ? ` Author: ${version .author } ` : null ;
7997 const createdOnValue = version .createdOn ;
80- const createdOn = createdOnValue
81- ? ` Created: ${formatDateString (
82- createdOnValue instanceof Date
83- ? createdOnValue .toISOString ()
84- : createdOnValue ,
85- )} `
86- : null ;
98+ const createdOn = createdOnValue ? formatCreatedOn (createdOnValue ) : null ;
8799 const rawDescription = version .description ?.trim () ?? " " ;
88100 let description: string | null = null ;
89101 if (rawDescription .length > 0 ) {
0 commit comments