Skip to content

Commit

Permalink
SkipDays validation correction
Browse files Browse the repository at this point in the history
  • Loading branch information
Dharanish committed Jun 25, 2024
1 parent 1d2734a commit e553eee
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,15 @@ class EditHabitActivity : AppCompatActivity() {
isValid = false
}
}
if (isSkipDays && freqDen == 7) {
if (7 - listSkipDays.numDays() < freqNum) {
if (isSkipDays) {
if (habitType == HabitType.YES_NO && freqDen == 7) {
if (7 - listSkipDays.numDays() < freqNum) {
binding.skipDaysPicker.text = getString(R.string.validation_too_many_skips)
binding.skipDaysPicker.error = getFormattedValidationError(R.string.validation_too_many_skips)
isValid = false
}
}
if (listSkipDays.numDays() == 7) {
binding.skipDaysPicker.text = getString(R.string.validation_too_many_skips)
binding.skipDaysPicker.error = getFormattedValidationError(R.string.validation_too_many_skips)
isValid = false
Expand Down

0 comments on commit e553eee

Please sign in to comment.