Skip to content

Add configurable units for duration and time ago formatting #190

Description

@barq-al-layl

It would be useful to let callers choose the unit used by HumanReadable.duration() and HumanReadable.timeAgo() instead of always auto-scaling to the largest readable unit.

Example use cases:

HumanReadable.duration(3.days, unit = DurationUnit.Hours) // "72 hours"
HumanReadable.timeAgo(instant, unit = DurationUnit.Days) // "32 days ago"

This would help when apps need consistent units in reports or UI labels where automatic unit switching can be confusing.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions