Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clock_hand to display correct hour hand #2240

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BarbUk
Copy link
Contributor

@BarbUk BarbUk commented Feb 8, 2024

Description

When using the lib to display the command duration, the dynamic clock is off by 1.

Motivation and Context

This change is required to have a dynamic clock that output the correct clock hand.

How Has This Been Tested?

Before:

for second in {1..15}; do     
  clock_hand=$(printf '%x' $(((${1:-${second}} % 12) + 144)))
  printf '%b' "\xf0\x9f\x95\x$clock_hand"
done

馃晳馃晵馃晸馃晹馃晻馃晼馃晽馃晿馃暀馃暁馃暃馃晲馃晳馃晵馃晸

After:

for second in {1..15}; do     
  clock_hand=$(printf '%x' $((((${1:-${second}} -1 ) % 12) + 144)))
  printf '%b' "\xf0\x9f\x95\x$clock_hand"
done

馃晲馃晳馃晵馃晸馃晹馃晻馃晼馃晽馃晿馃暀馃暁馃暃馃晲馃晳馃晵

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • If my change requires a change to the documentation, I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • If I have added a new file, I also added it to clean_files.txt and formatted it using lint_clean_files.sh.
  • I have added tests to cover my changes, and all the new and existing tests pass.

@BarbUk BarbUk marked this pull request as ready for review February 8, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant