johnnycwatt / Habit-Tracker

0 stars 0 forks source link

Restrict Completion to Habits with Custom Day selection. #1

Closed johnnycwatt closed 2 days ago

johnnycwatt commented 3 days ago

Currently, custom habits with specific days (e.g., Monday - Friday) allow users to mark them as completed on any day, including weekends. This affects statistics calculations, leading to inflated completion percentages (e.g., showing 120% completion).

Possible Solution: Modify the markHabitAsCompletedOnDate method in the ProgressController to restrict marking completion to the specified days for custom habits. Display a warning if the user attempts to mark completion on an unsupported day.

johnnycwatt commented 2 days ago

Resolved: Added a soft warning for users when attempting to mark a custom habit as completed on non-specified days. Users can still Mark a habit complete on the day, however they will not be able to mark previous days outside the custom schedule as complete. This allows flexibility while encouraging users to adhere to their custom schedules. In addition, the performance metrics are now capped at 100%, ensuring that extra completions won’t inflate the statistics.