picard icon indicating copy to clipboard operation
picard copied to clipboard

PICARD-2250: Add `$parsedate()` function

Open rdswift opened this issue 2 years ago • 3 comments

Summary

  • This is a…
    • [ ] Bug fix
    • [x] 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

  • JIRA ticket (optional): PICARD-2250

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 avatar Jul 27 '21 19:07 rdswift

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?

phw avatar Jul 30 '21 15:07 phw

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.

rdswift avatar Jul 30 '21 15:07 rdswift

@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.

zas avatar Jul 30 '21 17:07 zas