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

single digit dates with unambiguous month and year #99

Closed
millerjef opened this issue Jul 12, 2019 · 5 comments

Comments

@millerjef
Copy link

commented Jul 12, 2019

I am trying to parse:
anydate("August 4, 2018")

This returns NA. Frankly, this is consistent with the documentation in that anydate doesn't handle single digit days; however, I would argue that with the explicit month (August) and year (2018) that the algorithm (Boost Date_Time library) should be able to process this. Perhaps this issue is really with Boost Date_Time, if so, please let me know and I will post there.

Thanks! I appreciate your package!

@eddelbuettel

This comment has been minimized.

Copy link
Owner

commented Jul 12, 2019

It's a Boost limitation together with a not-present-by-default format:

> library(anytime)
> addFormats("%B %d, %Y")
> anydate("August 04, 2018")
[1] "2018-08-04"
> 

It requires the 0 I am afraid, and I can see little that can be done here.

@eddelbuettel

This comment has been minimized.

Copy link
Owner

commented Jul 21, 2019

Closing as duplicate, see

You can use useR=TRUE for the R parseer.

@eddelbuettel

This comment has been minimized.

Copy link
Owner

commented Aug 8, 2019

Good news - this now works in master (and hence the next release probably at the end of the month):

 R> anydate("August 4, 2018")
 [1] "2018-08-04"
 R>
@millerjef

This comment has been minimized.

Copy link
Author

commented Aug 9, 2019

Great news! Thank you!

@eddelbuettel

This comment has been minimized.

Copy link
Owner

commented Aug 9, 2019

Yes, makes me happy too as this was a wart. A bit embarassed it too me so long to find the obvious fix. But better late than never 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.