-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
invalid date crashes nushell #11710
Comments
This is upstream https://github.com/technologicalMayhem/human-date-parser/blob/a87d39c963fadbef1a9fbb06214497d83420d564/src/lib.rs#L186 where they're doing an unwrap() and shouldn't. Not sure what to do about it here. |
It's not a big deal, as far as I'm concerned. I was just playing around with Nushell, and since it's a panic, I wanted to let you know about it. And, I've just found out that you guys already implemented seq date, which does exactly what I wanted to achieve with a self-written for-loop and a little bit of date arithmetic. Keep up the great work! |
The issue was already reported upstream technologicalMayhem/human-date-parser#1. There are no replies and the crate seems unmaintained, so we can't hope for an upstream fix. We'd need to either remove the functionality, check if some other maintained crate could be used, or roll our own. |
I'd argue for removing human-readable dates interpretation. I feel like it's better suited for a plugin, not the core of the language. |
I feel like I'd be sad to see it go. I kind of like nushell-y-ness of |
I fixed the issue in my code. Sorry for only getting around to it now. |
i believe this was fixed recently, please ping me if it's not fixed on the latest main branch and i'll reopen. |
Describe the bug
Feeding
into datetime
with expressions that have a month-part greater than 12 crashes nu.How to reproduce
enter
"2023-13-31" | into datetime
Results in:
and Nu exits
Expected behavior
I expect Nu to catch this invalid input and show an error message, like eg. when doing
~> "2023-foo-31" | into datetime
:Screenshots
No response
Configuration
Tested on Linux/Intel (Ubuntu 23.10) installed from nu-0.89.0-x86_64-linux-gnu-full.tar.gz Github release.
and macOS/Apple Silicone (Sonoma 14.3) installed with Homebrew
Additional context
No response
The text was updated successfully, but these errors were encountered: