Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nglasl opened this issue Apr 12, 2022 · 0 comments
Open
Assignees

Comments

@nglasl
Copy link

nglasl commented Apr 12, 2022

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).

@pumpkinball pumpkinball self-assigned this Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants