Skip to content

Commit

Permalink
lib/theme: don't use date for $THEME_CLOCK_FORMAT
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelicWizard committed Feb 20, 2022
1 parent b1284c2 commit c7a50a9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion themes/base.theme.bash
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,17 @@ function clock_prompt() {
local CLOCK_STRING

if [[ "${SHOW_CLOCK}" == "true" ]]; then
CLOCK_STRING=$(date +"${CLOCK_FORMAT}")
case "${CLOCK_FORMAT}" in
'%H:%M:%S' | '%H:%M:%S'[$IFS])
CLOCK_STRING='\t'
;;
'%I:%M:%S' | '%I:%M:%S'[$IFS])
CLOCK_STRING='\T'
;;
*)
CLOCK_STRING="\D{${CLOCK_FORMAT}}"
;;
esac
echo -e "${CLOCK_COLOR}${CLOCK_THEME_PROMPT_PREFIX}${CLOCK_STRING}${CLOCK_THEME_PROMPT_SUFFIX}"
fi
}
Expand Down

0 comments on commit c7a50a9

Please sign in to comment.