deprecate --format and --list in into datetime#10017
Conversation
|
I like it but don't think we can move forward with it unless it respects @sholderbach was also working on a |
very good catch 👏 👏
i'd be happy to use a better and more clever system 😌 |
|
thanks to @kubouch expertise, i've switched to using |
fdncred
left a comment
There was a problem hiding this comment.
I think this is good for --options until we can get ShellWarning up and running, assuming we go that direction. I'm fine with landing this for now.
this avoids creating a working_set manually.
dc2f814 to
c9ffc56
Compare
|
( i force pushed the last commit only immediately to amend dc2f814 with a Clippy fix ) |
|
Let's move forward with this and see how it goes. |
|
@amtoine My understanding is the --format flag of From the documentation of parse_from_str:
|
|
Oh, |
|
so do we revert this PR? before the release? |
|
Maybe we need a better datetime parsing create. Seems silly that the first one would work but the last one wouldn't. I just took off the %z and +0000. ❯ '20210227_135540+0000' | into datetime -f '%Y%m%d_%H%M%S%z'
Sat, 27 Feb 2021 13:55:40 +0000 (2 years ago)
❯ '20210227_135540' | into datetime -f '%Y%m%d_%H%M%S'
Error: nu::shell::cant_convert
× Can't convert to could not parse as datetime using format '%Y%m%d_%H%M%S'.
╭─[entry #12:1:1]
1 │ '20210227_135540' | into datetime -f '%Y%m%d_%H%M%S'
· ──────┬──────
· ╰── can't convert input is not enough for unique date and time to could not parse as datetime using format '%Y%m%d_%H%M%S'
╰────
help: you can use `into datetime` without a format string to enable flexible parsing |
|
Seems like I kind of like this one too https://github.com/waltzofpearls/dateparser I guess my thought with these is to make it parse more date/datetime strings without having to use the |
#10055) related to - #10017 (comment) # Description this PR undeprecates `into datetime --format` and `into datetime --list`. this PR reverts commit f33b60c. # User-Facing Changes # Tests + Formatting # After Submitting
related to
Description
this PR
--formator--listoninto datetimeformat datecommand insteadi propose to
User-Facing Changes
into datetime --formatandinto datetime --listwill be deprecated in 0.85.how it looks
into datetime --listin the REPLinto datetime --listin a scripthelp into datetimeTests + Formatting
After Submitting