Closed wezm closed 1 year ago
Having a way to outright ignore characters could certainly be useful. In the meantime, once I get around to documenting the following, I will put out a release that includes it.
[weekday], [month repr:long] [day][first [st][nd][rd][th]], [year]
This would effectively do the same thing, taking the first of "st", "nd", "rd", and "th". In reality, which one is matched is irrelevant, as they're all literals.
This would effectively do the same thing, taking the first of "st", "nd", "rd", and "th". In reality, which one is matched is irrelevant, as they're all literals.
Cool, yes that would work well.
My previous suggestion was released a few days ago, so you should be able to use it now. I've also pushed up an implementation of [ignore count:X]
, though that's not yet released.
Thanks. I published a release using the git version, will be good to get back on a proper release.
For my project I need to be able to parse arbitrary dates as found on the internet. One such example that I haven't been able to work out how to parse with
time
uses this format:It's the ordinals (th, rd, st) that are the challenge. It would be great if format description either supported parsing/formatting these or had a mechanism to specify characters to ignore, like:
[weekday], [month repr:long] [day][ignore count:2], [year]
.I can probably work around this for now by detecting digits followed by an ordinal and deleting the ordinal, happy to hear if there are other ideas.