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

Incorrect handling of a date near daylight saving time end. #138

Closed
a1russell opened this issue Sep 15, 2021 · 2 comments
Closed

Incorrect handling of a date near daylight saving time end. #138

a1russell opened this issue Sep 15, 2021 · 2 comments

Comments

@a1russell
Copy link

a1russell commented Sep 15, 2021

If I write a test like:

it('formats a date near daylight saving time end, offsetting it to a given time zone', () => {
  const date = new Date('2020-10-31T21:37:02.233-05:00');
  const timeZone = 'America/Chicago';
  const offsetDate: Date = utcToZonedTime(date.toISOString(), timeZone);
  const result = format(offsetDate, "yyyy-MM-dd h:mmaaaaa'm' xxx", { timeZone });
  expect(result).toEqual('2020-10-31 9:37pm -05:00');
});

I receive a failure:

Error: Expected '2020-10-31 9:37pm -06:00' to equal '2020-10-31 9:37pm -05:00'.

This was working for some time, beginning with v1.0.11. The regression was introduced in v1.1.2. The current version (also broken) as I write this is v1.1.6.

@a1russell
Copy link
Author

Is there any more information I can provide on this? Or am I using the API incorrectly or something? I put some effort into filing this issue, so I would be pleased to see a response.

marnusw added a commit that referenced this issue Dec 20, 2021
@marnusw
Copy link
Owner

marnusw commented Dec 20, 2021

Thank you for the report. This issue was fixed in 72728b7 and 5eef1ec for release in 1.2.0.

@marnusw marnusw closed this as completed Dec 20, 2021
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