ultimate_alarm_clock icon indicating copy to clipboard operation
ultimate_alarm_clock copied to clipboard

Resolves issue#827, where `timeUntilAlarm` wasn't working as Expected

Open Gaurav-Kushwaha-1225 opened this issue 9 months ago • 3 comments

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 alarmDate Parameter: The timeUntilAlarm function now accepts an additional alarmDate parameter to handle date-based alarm scheduling.

  • Controller Updates: Now, if Rings On is enabled or selectedDate != DateTime.now(), then make the Repeat as Never or repeatDays = [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

Gaurav-Kushwaha-1225 avatar Apr 24 '25 19:04 Gaurav-Kushwaha-1225

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

Gaurav-Kushwaha-1225 avatar Apr 24 '25 20:04 Gaurav-Kushwaha-1225

Hii @Gaurav-Kushwaha-1225 take a look at PR(#830) which has good UI/UX and solves the ringson issue , rings in duration

mahendra-918 avatar Apr 27 '25 17:04 mahendra-918

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.

Gaurav-Kushwaha-1225 avatar Apr 28 '25 07:04 Gaurav-Kushwaha-1225