Skip to content

Extend $datetime->elapsedTimeStr() to show "months" and "years" #367

@isellsoap

Description

@isellsoap

Short description of the enhancement

Seen at https://processwire.com/talk/topic/21345-datetime-elapsedtimestr-not-showing-months-and-years/: I think it would make sense to extend $datetime->elapsedTimeStr() to also show months and years.

Current vs. suggested behavior

Currently $datetime->elapsedTimeStr() stops at "weeks", e.g. displaying "161 weeks", which is a bit weird. Instead, it should display "3 years, 4 months, …".

Why would the enhancement be useful to users?

For longer periods of time $datetime->elapsedTimeStr() doesn’t make much sense, because something like "254 weeks" isn’t something people are used to read or comprehend. Breaking that down into months and years would make this method a lot more useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions