In the cloud instance, we have seen the timeline feature sometime displays in relative format and sometimes in absolute format. Can you please let me know what's the logic behind showing the timeline in relative vs absolute terms? Is there a specific number of days where the timeline will be shown in relative (ex: 3 days ago, 2 hours ago etc) and beyond that it will be shown in absolute terms (ex: 7/2/25, 2:33 PM etc)
Solved! Go to Solution.
Views
Replies
Total Likes
Relative vs. absolute timestamps is controlled by the foundation-time component's underlying logic, which uses Coral UI's Coral.TimeAgo,
Specifically:
Timestamps ≤ 7 days old are shown in relative format:
e.g., “3 hours ago”, “5 days ago”
Timestamps > 7 days old are shown in absolute format:
e.g., “Jul 2, 2025, 2:33 PM”
This behaviour is client-side and powered by JavaScript.
It is not based on any AEM-specific Java back-end logic but relies on rendering by the Coral UI framework and the foundation-time element inside
clientlib:
/libs/granite/ui/components/coral/foundation/clientlibs/foundation/js/time/init.js
You can check the same with
<coral-timeago datetime="2025-07-02T14:33:00Z"></coral-timeago>
I think its 7 days. The DOM element which used to represent date in timeline is foundation-time
Clientlibs : /libs/granite/ui/components/coral/foundation/components/clientlibs/components
Relative vs. absolute timestamps is controlled by the foundation-time component's underlying logic, which uses Coral UI's Coral.TimeAgo,
Specifically:
Timestamps ≤ 7 days old are shown in relative format:
e.g., “3 hours ago”, “5 days ago”
Timestamps > 7 days old are shown in absolute format:
e.g., “Jul 2, 2025, 2:33 PM”
This behaviour is client-side and powered by JavaScript.
It is not based on any AEM-specific Java back-end logic but relies on rendering by the Coral UI framework and the foundation-time element inside
clientlib:
/libs/granite/ui/components/coral/foundation/clientlibs/foundation/js/time/init.js
You can check the same with
<coral-timeago datetime="2025-07-02T14:33:00Z"></coral-timeago>
Views
Likes
Replies
Views
Likes
Replies