Skip to content

Employee::getDateOfBirthAsDate not converting dates prior to 1970 correctly #272

Description

@nglasl

SDK you're using:

  • Version 2.9.0

Describe the bug
When retrieving a list of employees, we noticed some of them coming back with the incorrect date of birth, more specifically when their date of birth was prior to 1970.

To Reproduce
Steps to reproduce the behavior:

  1. Use "DateOfBirth": "/Date(-310867200000+0000)/", when calling Employee::getDateOfBirthAsDate.
  2. This will return 1979, but it should actually return 1960.
  3. If you use Date::toDateTime from https://github.com/webapix/dot-net-json-date-formatter this will actually convert to 1960 correctly.
  4. I tried updating to the latest version of the library, but this still uses the same logic and gives the incorrect date.

Expected behavior
This date should be converted to 1960 and not 1979.

Screenshots
N/A

Additional context
The logic inside StringUtil::convertStringToDate and StringUtil::convertStringToDateTime just need to be updated to something similar to the other library (perhaps even introducing that library as a dependency).

Activity

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

Metadata

Metadata

Assignees

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