Skip to content

Stray days added to duration #262

Description

@TymekDev

Hey, I am having an issue where the relative time between 2022-07-11T09:00:00+02:00 and 2023-07-11T09:00:00+02:00 is 1 year, 5 days instead of 1 year. Similarly 2023-05-11T09:00:00+02:00 and 2023-07-11T09:00:00+02:00 are 2 months, 1 day where I'd expect it to be just 2 months. As I shorten or lengthen the difference between datetimes the days decrease or increase respectively.

I can think of possibilities at calculation level where these come from, however I find the human-readable duration confusing.

Activity

  1. keithamus commented on Jul 11, 2023

    @keithamus
    Contributor

    That does seem confusing. Would you kindly add a set of failing tests around here:

    {
    reference: '2023-03-23T12:03:00.000Z',
    datetime: '2023-03-21T16:03:00.000Z',
    format: 'relative',
    tense: 'past',
    expected: '2 days ago',
    },

    If you raise a PR where the expected is your desired text, and we can look at a fix.

  2. francinelucca commented on Aug 27, 2026

    @francinelucca
    Contributor

    👋🏽 validated failing test cases are valid #263 and spent some time during FR shift chugging at a solution . Unfortunately the fix is not straight forward as there's a lot of considerations/decisions to be made here. Since this is a bigger effort that falls outside the scope of FR, adding to team inbox so we can discuss at triage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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