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

date now evaluates to "now" #4698

Closed
ghost opened this issue Mar 2, 2022 · 7 comments · Fixed by #4790
Closed

date now evaluates to "now" #4698

ghost opened this issue Mar 2, 2022 · 7 comments · Fixed by #4790
Milestone

Comments

@ghost
Copy link

ghost commented Mar 2, 2022

Describe the bug

date now prints out a literal "now" value instead of the current date.

How to reproduce

  1. date now

Expected behavior

I expect it to print the full date.

Screenshots

No response

Configuration

key value
version 0.59.1
branch main
short_commit 88d7b50
commit_hash 88d7b50
commit_date 2022-03-02 12:52:24 +00:00
build_os macos-x86_64
rust_version rustc 1.59.0 (9d1b2106e 2022-02-23)
rust_channel stable-x86_64-apple-darwin
cargo_version cargo 1.59.0 (49d8809dc 2022-02-10)
pkg_version 0.59.1
build_time 2022-03-02 13:00:29 -05:00
build_rust_channel release
features dataframe, default, trash, which, zip
installed_plugins

Additional context

No response

@ghost
Copy link
Author

ghost commented Mar 2, 2022

Might relate to changes in #4661.

@jmoore34
Copy link
Contributor

jmoore34 commented Mar 2, 2022

This happens because autoview for DateTime gives the same output as date humanize. Perhaps this could be changed or made customizable (#3735).

Edit: er, it seems autoview was removed in e-q

As a workaround, you can do date now | date format or simply date format.

@stormasm
Copy link
Contributor

stormasm commented Mar 2, 2022

I have seen this as well, it has been "broken" now for "awhile", not exactly sure how long....

@sophiajt
Copy link
Contributor

sophiajt commented Mar 2, 2022

yeah, we could make it output the RFC3339 format if used as a value by itself maybe? I like the human format for tables like ls but as a single value I agree it can be confusing that the thing you're looking at is actually a date

@jmoore34
Copy link
Contributor

jmoore34 commented Mar 2, 2022

Perhaps it could display both, e.g. Wed, 02 Mar 2022 14:42:37 -0600 (now).

I was also thinking it might be cool to be able to provide a block in the config that determines how it displays, that way the user could also tweak the locale-specific parts and add colors and such.

Can $config values be set to blocks or is that just environmental variables?

@ghost
Copy link
Author

ghost commented Mar 3, 2022

This happens because autoview for DateTime gives the same output as date humanize. Perhaps this could be changed or made customizable (#3735).

swell! Thanks for the explanation and workaround @jmoore34!

I am not blocked on a fix or anything too.
Just wanted to do my OSS part to make visible so others can see we are aware and jamming on a solution.

@rgwood
Copy link
Contributor

rgwood commented Mar 7, 2022

date now is used as an example in the Nu Book introduction so that might need to be updated when this issue is resolved.

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

Successfully merging a pull request may close this issue.

5 participants