Merge pull request #1391 from Philoul/New/ReduceTimeOffsetConstraintinCarbsDialog
Modify Constraint of Carbs Dialog for Time Offset in past
This commit is contained in:
commit
1d2a25b56c
1 changed files with 2 additions and 2 deletions
|
@ -72,7 +72,7 @@ class CarbsDialog : DialogFragmentWithDate() {
|
|||
private fun validateInputs() {
|
||||
val maxCarbs = constraintChecker.getMaxCarbsAllowed().value().toDouble()
|
||||
val time = binding.time.value.toInt()
|
||||
if (time > 12 * 60 || time < -12 * 60) {
|
||||
if (time > 12 * 60 || time < -7 * 24 * 60) {
|
||||
binding.time.value = 0.0
|
||||
ToastUtils.showToastInUiThread(ctx, rh.gs(R.string.constraintapllied))
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ class CarbsDialog : DialogFragmentWithDate() {
|
|||
val maxCarbs = constraintChecker.getMaxCarbsAllowed().value().toDouble()
|
||||
binding.time.setParams(
|
||||
savedInstanceState?.getDouble("time")
|
||||
?: 0.0, -12 * 60.0, 12 * 60.0, 5.0, DecimalFormat("0"), false, binding.okcancel.ok, textWatcher
|
||||
?: 0.0, -7 * 24 * 60.0, 12 * 60.0, 5.0, DecimalFormat("0"), false, binding.okcancel.ok, textWatcher
|
||||
)
|
||||
|
||||
binding.duration.setParams(
|
||||
|
|
Loading…
Reference in a new issue