mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Improve time since post date displays
- 15 days now is "15 days" rather than "3 weeks" ago. - 32 days is now "1 month" rather than "2 months" ago. - 366 days is now "1 year" rather than "2 years" ago. Closes #267
This commit is contained in:
parent
5cd7152ae7
commit
3d04d92aa2
2 changed files with 9 additions and 5 deletions
|
@ -111,8 +111,12 @@ func TestElapsedTime(t *testing.T) {
|
|||
{time.Now().Add(-time.Hour * 3), printer.Plural("time_elapsed.hours", 3, 3)},
|
||||
{time.Now().Add(-time.Hour * 32), printer.Printf("time_elapsed.yesterday")},
|
||||
{time.Now().Add(-time.Hour * 24 * 3), printer.Plural("time_elapsed.days", 3, 3)},
|
||||
{time.Now().Add(-time.Hour * 24 * 14), printer.Plural("time_elapsed.weeks", 2, 2)},
|
||||
{time.Now().Add(-time.Hour * 24 * 14), printer.Plural("time_elapsed.days", 14, 14)},
|
||||
{time.Now().Add(-time.Hour * 24 * 15), printer.Plural("time_elapsed.days", 15, 15)},
|
||||
{time.Now().Add(-time.Hour * 24 * 21), printer.Plural("time_elapsed.weeks", 3, 3)},
|
||||
{time.Now().Add(-time.Hour * 24 * 32), printer.Plural("time_elapsed.months", 1, 1)},
|
||||
{time.Now().Add(-time.Hour * 24 * 60), printer.Plural("time_elapsed.months", 2, 2)},
|
||||
{time.Now().Add(-time.Hour * 24 * 366), printer.Plural("time_elapsed.years", 1, 1)},
|
||||
{time.Now().Add(-time.Hour * 24 * 365 * 3), printer.Plural("time_elapsed.years", 3, 3)},
|
||||
}
|
||||
for i, tt := range dt {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue