Skip to content

Incorrect Calculation of relative time for tomorrow #4

@im28

Description

@im28

There is a bug when calculating the relative days in the future as shown by the test below. I think the time difference calculated is not normalised correctly

test('one day formats as tomorrow', () {
        DateTime now = DateTime.now();
        DateTime nextMidnight = DateTime(now.year, now.month, now.day + 1);
        Duration timeUntilNextMidnight = nextMidnight.difference(now);
        _testFormat(
            fromNow: (DateTime now) => now.add(timeUntilNextMidnight),
            matcher: 'tomorrow',
            timeUnits: [TimeUnit.day]);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions