@@ -41,7 +41,7 @@ import {
4141 deleteReaction ,
4242} from "ente-new/photos/services/reaction" ;
4343import { type UnifiedReaction } from "ente-new/photos/services/social" ;
44- import { t } from "i18next" ;
44+ import i18n , { t } from "i18next" ;
4545import React , {
4646 useCallback ,
4747 useEffect ,
@@ -180,14 +180,31 @@ interface CollectionInfo {
180180const formatTimeAgo = ( timestampMicros : number ) : string => {
181181 // Server timestamps are in microseconds, convert to milliseconds
182182 const timestampMs = Math . floor ( timestampMicros / 1000 ) ;
183- const diff = Date . now ( ) - timestampMs ;
183+ const now = Date . now ( ) ;
184+ const diff = now - timestampMs ;
184185 const minutes = Math . floor ( diff / 60000 ) ;
185- if ( minutes < 1 ) return "now" ;
186- if ( minutes < 60 ) return ` ${ minutes } m ago` ;
186+ if ( minutes < 1 ) return t ( "just_now" ) ;
187+ if ( minutes < 60 ) return t ( "minutes_ago" , { count : minutes } ) ;
187188 const hours = Math . floor ( minutes / 60 ) ;
188- if ( hours < 24 ) return ` ${ hours } h ago` ;
189+ if ( hours < 24 ) return t ( "hours_ago" , { count : hours } ) ;
189190 const days = Math . floor ( hours / 24 ) ;
190- return `${ days } d ago` ;
191+ if ( days < 7 ) return t ( "days_ago" , { count : days } ) ;
192+
193+ // For 7+ days, show actual date using locale-aware formatting
194+ const date = new Date ( timestampMs ) ;
195+ const currentYear = new Date ( now ) . getFullYear ( ) ;
196+ const locale = i18n . language ;
197+ if ( date . getFullYear ( ) === currentYear ) {
198+ return date . toLocaleDateString ( locale , {
199+ month : "short" ,
200+ day : "numeric" ,
201+ } ) ;
202+ }
203+ return date . toLocaleDateString ( locale , {
204+ month : "short" ,
205+ day : "numeric" ,
206+ year : "numeric" ,
207+ } ) ;
191208} ;
192209
193210const getParentComment = (
0 commit comments