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

PICARD-2250: Add $parsedate() function #1872

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rdswift
Copy link
Collaborator

@rdswift rdswift commented Jul 27, 2021

Summary

  • This is a…
    • Bug fix
    • Feature addition
    • Refactoring
    • Minor / simple change (like a typo)
    • Other
  • Describe this change in 1-2 sentences: Add new $parsedate() function that uses the dateutil.parser.parse method.

Problem

There is currently no scripting function capable of parsing dates in a variety of formats, including months as text.

Solution

Add a new $parsedate() function that uses the dateutil.parser.parse method. This allows parsing input dates such as "September 23, 2017" or "23 Sept 2017" into "YYYY-MM-DD" format for use with other date-related scripting functions.

Action

Update documentation.

@rdswift rdswift mentioned this pull request Jul 27, 2021
34 tasks
picard/script/functions.py Outdated Show resolved Hide resolved
@phw
Copy link
Member

phw commented Jul 30, 2021

My only concern is that I had thought after our recent discussion that we might get completely rid of the dateutil dependency.

Is there any concrete use case for this function?

@zas what do you think?

@rdswift
Copy link
Collaborator Author

rdswift commented Jul 30, 2021

My only concern is that I had thought after our recent discussion that we might get completely rid of the dateutil dependency.

Oh right. I forgot about that.

Is there any concrete use case for this function?

I have no examples.

I was only adding this to complete our date handling functions. Since nobody else has requested such functionality, perhaps it might be best to drop it for now and cancel this PR.

@zas
Copy link
Collaborator

zas commented Jul 30, 2021

@zas what do you think?

Well, we can introduce such feature at any time, and we wanted to get rid of dateutil dependency, so I would keep this PR for later.

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