Resolves issue#827, where `timeUntilAlarm` wasn't working as Expected
Description
Now, the alarm scheduling logic incorporates the alarmDate parameter into the timeUntilAlarm function for the calculation of a non-repeating alarm that's scheduled after some days.
Also, you can refer to this small discussion #gsoc-ultimate-alarm-clock > @ 💬, regarding the Repeat and Rings On feature, where it was proposed to disable the Rings On when Repeat is enabled, or vice versa.
Proposed Changes
-
Added
alarmDateParameter: ThetimeUntilAlarmfunction now accepts an additional alarmDate parameter to handle date-based alarm scheduling. -
Controller Updates: Now, if
Rings Onis enabled orselectedDate != DateTime.now(), then make theRepeatas Never orrepeatDays = [false, false, false, false, false, false, false]. Or, vice versa.
Fixes #827
Screenshots
In the video below, the calculation for Rings in __ is now accurate for alarms set on a specific date. And, selecting both a specific date alarm and a repeat alarm is not possible, since enabling one will disable the other.
https://github.com/user-attachments/assets/23e0f172-ca80-4ac9-b3be-a928bd96f491
Checklist
- [x] Tests have been added or updated to cover the changes
- [x] Documentation has been updated to reflect the changes
- [x] Code follows the established coding style guidelines
- [x] All tests are passing
In the latest commit, I also resolved a problem in calculating the rings in value for an alarm, set for repeat on a day which is the same as today.
Like in the video below, today is Friday, and 'Rings in' was giving "Rings in No upcoming alarms", instead of "Rings in 6 days", when set the repeating day as Friday itself.
| Video from the latest commit in the main branch | Video from the latest commit on this PR |
|---|---|
Hii @Gaurav-Kushwaha-1225 take a look at PR(#830) which has good UI/UX and solves the ringson issue , rings in duration
Hi @mahendra-918, I saw your PR (#830) — it looks good!
However, I noticed that you've made some significant changes to the UI as well. The original issue #827 you addressed was specifically about the bug in the timeUntilAlarm method that calculates the Rings in __ value.
If you are planning to implement any additional ideas, it would be better to discuss them first in the Zulip discussion group to get some feedback from mentors and community members.