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

Move date parsing logic to DateParser #189

Closed
wants to merge 2 commits into from
Closed

Conversation

RemboL
Copy link

@RemboL RemboL commented Aug 11, 2020

Recently I implemented DateValue function that would parse dates in different formats.

Since then, I noticed that there are other functions (YEARFRAC, in particular) that use date parsing logic and that they are using a class DateParser. This brought my attention, because DateParser is unable to parse dates in other formats, like 'yyyy-MM-dd'.

I think it would make sense to use the same logic for date parsing in all places, so I moved my code from DateValue function to DateParser. Since both DateParser and DateValue tests are still green without any changes, I think this refactor is valid.

I also moved DateParser from atp package to util, since it is used outside atp now - although I see that it might raise some flags, since it is a public class and theoretically it might break compatibility for other projects that might be using DateParser - please advice, whether it is acceptable to move this class or should it be left in current package.

@asfgit asfgit closed this in e86ba86 Aug 11, 2020
@pjfanning
Copy link
Contributor

Thanks - merged with e86ba86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants