0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Added Just now as a timestamp

ref https://linear.app/tryghost/issue/AP-282/render-notes-in-the-frontend
This commit is contained in:
Djordje Vlaisavljevic 2024-09-19 20:27:05 +01:00 committed by Fabien 'egg' O'Carroll
parent 0cf5d11bf2
commit 4aa5e4f091

View file

@ -26,8 +26,12 @@ export const getRelativeTimestamp = (date: Date): string => {
if (interval >= 1) {
return `${interval}m`;
}
if (seconds < 1) {
return `Just now`;
}
return `${seconds} seconds`;
return `${seconds}s`;
};
export default getRelativeTimestamp;