Careportal Remove Duration ValueWithUnit if empty

This commit is contained in:
Philoul 2021-03-07 10:52:42 +01:00
parent 523a9f2800
commit c931c8d25a

View file

@ -186,7 +186,7 @@ class CareDialog : DialogFragmentWithDate() {
}
if (options == EventType.NOTE || options == EventType.EXERCISE) {
actions.add(resourceHelper.gs(R.string.careportal_newnstreatment_duration_label) + ": " + resourceHelper.gs(R.string.format_mins, binding.duration.value.toInt()))
valuesWithUnit.add(ValueWithUnit(binding.duration.value.toInt(), Units.M))
if (!binding.duration.value.equals(0.0)) valuesWithUnit.add(ValueWithUnit(binding.duration.value.toInt(), Units.M))
json.put("duration", binding.duration.value.toInt())
}
val notes = binding.notesLayout.notes.text.toString()