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

parsing dates with MMM for Ukrainian returns invalid dates #3137

Closed
vadimpopa opened this issue Jul 26, 2022 · 1 comment
Closed

parsing dates with MMM for Ukrainian returns invalid dates #3137

vadimpopa opened this issue Jul 26, 2022 · 1 comment

Comments

@vadimpopa
Copy link
Contributor

Test Code:

import { format, parse } from "date-fns";
import uk from "date-fns/locale/uk";

const locale = { locale: uk };
const dateIn = new Date("August 3, 2002 03:24:50");
const formatStyle = "d MMM y 'р'.";
const formatted = format(dateIn, formatStyle, locale); // 3 серп. 2002 р.
const parsed = parse(formatted, formatStyle, new Date(), locale); //Invalid Date

Failling dates/months:

new Date("March 3, 2002 03:24:50");
new Date("September 3, 2002 03:24:50");
new Date("April 3, 2002 03:24:50");
new Date("June 3, 2002 03:24:50");
new Date("August 3, 2002 03:24:50");
new Date("September 3, 2002 03:24:50");
new Date("Octomber 3, 2002 03:24:50");
@vadimpopa
Copy link
Contributor Author

PR #3139 should fix this.

@vadimpopa vadimpopa changed the title parse "d MMM y 'р'." date for Ukrainian locale returns invalid date parsing dates with MMM for Ukrainian returns invalid dates Jul 27, 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

No branches or pull requests

1 participant