Skip to content

Conversation

@crimsonclyde
Copy link
Contributor

Issue:
The word clock displays time phrases incorrectly for certain times.

Specifically:
"IT IS n TO n" is showing one hour in advance.
"IT IS HALF PAST n" is showing an hour regressive.

Proposed Solution:
This merge request introduces adjustments to the time calculation logic to address these issues. The changes include:

  • Incrementing the hour only when the minutes are 35 or more. This is necessary for correct representation of "to" phrases (e.g., "twenty to eight" should be displayed at 19:40).
  • Ensuring the correct handling of the 12-hour format conversion. This involves adjusting the hour incrementation to accurately reflect the transition from AM to PM and vice versa.
  • Using "PAST" for minutes between 5 and 34, inclusive. This ensures that times like "half past seven" are displayed correctly (e.g., at 19:30).

These changes aim to ensure that the clock accurately reflects phrases involving "past" and "to," addressing the current issues with hour advancement and regression.

Issue:
The word clock displays time phrases incorrectly for certain times. 

Specifically:
        "IT IS n TO n" is showing one hour in advance.
        "IT IS HALF PAST n" is showing an hour regressive.

Proposed Solution:
This merge request introduces adjustments to the time calculation logic to address these issues. The changes include:

- Incrementing the hour only when the minutes are 35 or more. This is necessary for correct representation of "to" phrases (e.g., "twenty to eight" should be displayed at 19:40).
- Ensuring the correct handling of the 12-hour format conversion. This involves adjusting the hour incrementation to accurately reflect the transition from AM to PM and vice versa.
- Using "PAST" for minutes between 5 and 34, inclusive. This ensures that times like "half past seven" are displayed correctly (e.g., at 19:30).

These changes aim to ensure that the clock accurately reflects phrases involving "past" and "to," addressing the current issues with hour advancement and regression.
@techniccontroller techniccontroller merged commit d85acfe into techniccontroller:main Jan 7, 2024
@techniccontroller
Copy link
Owner

Hi Clyde,
thank you for the fix.
As I have no English version of the wordclock, I was never testing the code properly ;)

Best regards
Edgar

@crimsonclyde
Copy link
Contributor Author

crimsonclyde commented Jan 7, 2024 via email

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.

2 participants