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:
Mario Zigliotto
2015-08-23 14:56:48 -07:00
committed by Caio Gondim
parent fe2d8d81fb
commit c93bb14ffb
2 changed files with 6 additions and 1 deletions

View File

@@ -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: