Key Features
Converts DateTime values into natural, user-friendly text
Supports past and future dates
Handles common expressions like:
Just now
Minutes, hours, days, months, years
Yesterday / Tomorrow
Automatically pluralizes time units
Safe handling of invalid dates
Use Cases
Activity feeds (e.g., “Updated 2 hours ago”)
Notifications and alerts
Audit logs
Chat and messaging timelines
Task and event lists
Any UI where readable time improves clarity
How It Works
The component compares a given DateTime with the current system time and calculates the difference.Based on the duration, it returns a meaningful text representation instead of a raw timestamp.
Example outputs:
3 minutes ago
Yesterday
In 2 days
5 months ago