-
Notifications
You must be signed in to change notification settings - Fork 207
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
Mistake in French locale #194
Comments
Works fine for me under linux:
What do you get on
A very long thread #181 might be relevant here, but would good to know more about the system. |
You are right, the problem is on my end:
I am running Mac OS X, with the whole system set to English. Session info:
It'd be useful to clarify why juillet is the only month that does not parse, though. The rest of the months work fine. |
On OS X the locale is called > lubridate:::.build_locale_regs("fr_FR")$alpha_exact[["b"]]
[1] "((?<b_b_e>jan|fév|mar|avr|mai|jui|jul|aoû|sep|oct|nov|déc)|(?<B_b_e>janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre))(?![[:alpha:]])" It's not obvious why julliet fails to match that regexp though. |
Same thing here:
And it does work elsewhere:
|
I meant that juillet is parsed for me on linux:
So it is again a regexp issue on OS and it is getting closer to our Japanese friend problem. |
Interestingly, it also fails in |
R 3.0.3 has solved this issue:
The mistake it caused in library(lubridate)
clean_date = function(x) {
# fix bugs in dates
x = gsub("juillet", "07", x) # fix small bug in French month parser
# parse to Date format
x = parse_date_time(x, "%d %m* %Y", locale = "fr_FR.UTF-8")
x = as.Date(x)
return(x)
}
unclean_date = function(x) {
# parse to Date format
x = parse_date_time(x, "%d %m* %Y", locale = "fr_FR.UTF-8")
x = as.Date(x)
return(x)
}
clean_date("15 juillet 2007")
[1] "2007-07-15"
# returns NA on R < 3.0.3
unclean_date("15 juillet 2007")
[1] "2007-07-15" The "juillet" month does not need fixing anymore. |
Hello,
There is a parsing issue in the French locale:
The month
juillet
is the monthjuly
.If this is not an issue with
lubridate
itself, please let me where shall I report this?The text was updated successfully, but these errors were encountered: