mirror of
https://github.com/Cornelicorn/bullet-train.zsh.git
synced 2025-12-06 11:50:38 +01:00
Add support for displaying time in 12-hour format
- Introduces a flag, `$BULLETTRAIN_TIME_12HR`, indicating if 12-hour format should be used - Default to 24 hour time - Document new option in README
This commit is contained in:
committed by
Caio Gondim
parent
fe2d8d81fb
commit
c93bb14ffb
@@ -121,6 +121,7 @@ or don't want to see. All options must be overridden in your **.zshrc** file.
|
||||
|Variable|Default|Meaning
|
||||
|--------|-------|-------|
|
||||
|`BULLETTRAIN_TIME_SHOW`|`true`|Show/hide that segment
|
||||
|`BULLETTRAIN_TIME_12HR`|`false`|Format time using 12-hour clock (am/pm)
|
||||
|`BULLETTRAIN_TIME_BG`|`''`|Background color
|
||||
|`BULLETTRAIN_TIME_FG`|`''`|Foreground color
|
||||
|
||||
|
||||
@@ -369,7 +369,11 @@ prompt_time() {
|
||||
return
|
||||
fi
|
||||
|
||||
prompt_segment $BULLETTRAIN_TIME_BG $BULLETTRAIN_TIME_FG '%D{%H:%M:%S}'
|
||||
if [[ $BULLETTRAIN_TIME_12HR == true ]] then
|
||||
prompt_segment $BULLETTRAIN_TIME_BG $BULLETTRAIN_TIME_FG %D{%r}
|
||||
else
|
||||
prompt_segment $BULLETTRAIN_TIME_BG $BULLETTRAIN_TIME_FG %D{%R}
|
||||
fi
|
||||
}
|
||||
|
||||
# Status:
|
||||
|
||||
Reference in New Issue
Block a user