File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -63,12 +63,14 @@ export const generateElapsedTimeText = (timeString: string) => {
6363 const minutes = Math . floor ( seconds / 60 ) ;
6464 const hours = Math . floor ( minutes / 60 ) ;
6565 const days = Math . floor ( hours / 24 ) ;
66+ const months = Math . floor ( days / 30 ) ;
6667 const years = Math . floor ( days / 365 ) ;
6768
6869 if ( millisecondsDiff < 60000 ) return 'Just now' ;
6970 else if ( minutes < 60 ) return minutes === 1 ? '1 minute ago' : `${ minutes } minutes ago` ;
7071 else if ( hours < 24 ) return hours === 1 ? '1 hour ago' : `${ hours } hours ago` ;
71- else if ( days < 365 ) return days === 1 ? '1 day ago' : `${ days } days ago` ;
72+ else if ( days < 30 ) return days === 1 ? '1 day ago' : `${ days } days ago` ;
73+ else if ( months < 12 ) return months === 1 ? '1 month ago' : `${ months } months ago` ;
7274 else return years === 1 ? '1 year ago' : `${ years } years ago` ;
7375} ;
7476
You can’t perform that action at this time.
0 commit comments