From 7c80067900bf7c54458385c4cfc9f8819195518e Mon Sep 17 00:00:00 2001 From: JT <547158+jntrnr@users.noreply.github.com> Date: Sun, 2 Jul 2023 20:25:22 +1200 Subject: [PATCH] use an easier-to-read date format in prompt (#9585) # Description Switches the right prompt to use an easier-to-read date format (YYYY-MM-DD) It's currently using (MM-DD-YYYY) which is only used in a few countries but it is unfortunately ambiguous with countries that use (DD-MM-YYYY) format (most countries). While YYYY-MM-DD is used in fewer countries than DD-MM-YYYY it's at least unambiguous to MM-DD-YYYY countries. More info: https://en.wikipedia.org/wiki/Date_format_by_country Alternatively, we could spell out the month name (even abbreviated) to make it clear as well. # User-Facing Changes Just changes the date in the default right prompt # Tests + Formatting # After Submitting --- crates/nu-utils/src/sample_config/default_env.nu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/nu-utils/src/sample_config/default_env.nu b/crates/nu-utils/src/sample_config/default_env.nu index 6bbe240e11..b554fe5bba 100644 --- a/crates/nu-utils/src/sample_config/default_env.nu +++ b/crates/nu-utils/src/sample_config/default_env.nu @@ -29,7 +29,7 @@ def create_right_prompt [] { let time_segment = ([ (ansi reset) (ansi magenta) - (date now | date format '%m/%d/%Y %r') + (date now | date format '%Y/%m/%d %r') ] | str join | str replace --all "([/:])" $"(ansi green)${1}(ansi magenta)" | str replace --all "([AP]M)" $"(ansi magenta_underline)${1}")