Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

DateTimeSpan not calculating correctly #63

Closed
ferdyrod opened this issue Sep 19, 2019 · 0 comments
Closed

DateTimeSpan not calculating correctly #63

ferdyrod opened this issue Sep 19, 2019 · 0 comments

Comments

@ferdyrod
Copy link

Hi,

I'm doing some testing with the DateTimeSpan class and I've been having some issues with the calculations.

if a have the following

    val startDate = DateTime.fromString("Mon, 01 Jan 2019 00:00:00 UTC").local
    val endDate = DateTime.fromString("Sat, 01 Sep 2019 00:00:00 UTC").local
    val span = (startDate until endDate).span

    assertEquals("8", span.totalMonths)  //Fails due to span calculation being '7M 4W 3D'

It fails because it's not calculating the 8 months difference there is between the two dates.

@soywiz soywiz closed this as completed in c16eab9 Sep 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant