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

fromHttp fails for Wednesdays #1224

Closed
Maxim-Mazurok opened this issue Jun 29, 2022 · 1 comment · Fixed by #1225
Closed

fromHttp fails for Wednesdays #1224

Maxim-Mazurok opened this issue Jun 29, 2022 · 1 comment · Fixed by #1225

Comments

@Maxim-Mazurok
Copy link
Contributor

Maxim-Mazurok commented Jun 29, 2022

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Please share a minimal code example that triggers the problem:

it("Monday", () => {
  const str = "Monday, 27-Jun-22 08:49:37 GMT";
  expect(DateTime.fromHTTP(str).isValid).toBe(true);
});
it("Tuesday", () => {
  const str = "Tuesday, 28-Jun-22 08:49:37 GMT";
  expect(DateTime.fromHTTP(str).isValid).toBe(true);
});
it("Wednesday", () => {
  // FAILS
  const str = "Wednesday, 29-Jun-22 08:49:37 GMT";
  expect(DateTime.fromHTTP(str).isValid).toBe(true);
});
it("29-Jun-21", () => {
  const str = "Tuesday, 29-Jun-21 08:49:37 GMT";
  expect(DateTime.fromHTTP(str).isValid).toBe(true);
});
it("Thursday", () => {
  const str = "Thursday, 30-Jun-22 08:49:37 GMT";
  expect(DateTime.fromHTTP(str).isValid).toBe(true);
});
it("Friday", () => {
  const str = "Friday, 01-Jul-22 08:49:37 GMT";
  expect(DateTime.fromHTTP(str).isValid).toBe(true);
});

/*
   √ works
   √ Monday
   √ Tuesday
   × Wednesday
   √ Wednesday 2021
   √ Thursday
   √ Friday
*/

Actual vs Expected behavior
I expect fromHTTP to work for 29 Jun 2022, instead I'm getting parse error.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Node 18.4.0
  • Luxon version 2.4.0
  • Your timezone Sydney (AEST)

Additional context
Add any other context about the problem here.
"Wed, 29 Jun 2022 08:05:35 GMT" works but not Wednesday, 29-Jun-22 08:49:37 GMT

@Maxim-Mazurok
Copy link
Contributor Author

Found issue, PR on it's way

@Maxim-Mazurok Maxim-Mazurok changed the title fromHttp fails on 29 Jun 2022 fromHttp fails for Wednesdays Jun 29, 2022
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

Successfully merging a pull request may close this issue.

1 participant