diff --git a/functions/_tide_item_time.fish b/functions/_tide_item_time.fish index b8522bc4..332bb398 100644 --- a/functions/_tide_item_time.fish +++ b/functions/_tide_item_time.fish @@ -1,3 +1,3 @@ function _tide_item_time - _tide_print_item time (date +$tide_time_format) + _tide_print_item time $tide_time_icon' ' (date +$tide_time_format) end diff --git a/functions/tide/configure/icons.fish b/functions/tide/configure/icons.fish index 70611cdf..9f74fa1a 100644 --- a/functions/tide/configure/icons.fish +++ b/functions/tide/configure/icons.fish @@ -33,6 +33,7 @@ tide_status_icon ✔ tide_status_icon_failure ✘ tide_terraform_icon 󱁢 tide_toolbox_icon  +tide_time_icon  tide_vi_mode_icon_default D tide_vi_mode_icon_insert I tide_vi_mode_icon_replace R diff --git a/tests/_tide_item_time.test.fish b/tests/_tide_item_time.test.fish index 846a737d..a42cffe8 100644 --- a/tests/_tide_item_time.test.fish +++ b/tests/_tide_item_time.test.fish @@ -5,6 +5,8 @@ function _time -a format LC_TIME=en_US.UTF-8 _tide_decolor (tide_time_format="$format" _tide_item_time) end +set -lx tide_time_icon = + # None _time '' # CHECK: @@ -13,3 +15,14 @@ _time %T # CHECK: {{\d\d:\d\d:\d\d}} # 12 Hour _time %r # CHECK: {{\d\d:\d\d:\d\d (A|P)M}} + +set -lx tide_time_icon =  + +# Only Icon +_time '' # CHECK:  + +# 24 Hour With Icon +_time %T # CHECK:  {{\d\d:\d\d:\d\d}} + +# 12 Hour With Icon +_time %r # CHECK:  {{\d\d:\d\d:\d\d (A|P)M}}