@@ -114,11 +114,11 @@ class TempTargetDialog : DialogFragmentWithDate() {
114
114
val reason = overview_temptarget_reason.selectedItem.toString()
115
115
val unitResId = if (ProfileFunctions .getSystemUnits() == Constants .MGDL ) R .string.mgdl else R .string.mmol
116
116
val target = overview_temptarget_temptarget.value
117
- val duration = overview_temptarget_duration.value
118
- if (target != 0.0 && duration != 0.0 ) {
117
+ val duration = overview_temptarget_duration.value.toInt()
118
+ if (target != 0.0 && duration != 0 ) {
119
119
actions.add(MainApp .gs(R .string.reason) + " : " + reason)
120
120
actions.add(MainApp .gs(R .string.nsprofileview_target_label) + " : " + Profile .toCurrentUnitsString(target) + " " + MainApp .gs(unitResId))
121
- actions.add(MainApp .gs(R .string.duration) + " : " + MainApp .gs(R .string.format_hours , duration))
121
+ actions.add(MainApp .gs(R .string.duration) + " : " + MainApp .gs(R .string.format_mins , duration))
122
122
} else {
123
123
actions.add(MainApp .gs(R .string.stoptemptarget))
124
124
}
@@ -128,7 +128,7 @@ class TempTargetDialog : DialogFragmentWithDate() {
128
128
activity?.let { activity ->
129
129
OKDialog .showConfirmation(activity, MainApp .gs(R .string.careportal_temporarytarget), HtmlHelper .fromHtml(Joiner .on(" <br/>" ).join(actions)), Runnable {
130
130
log.debug(" USER ENTRY: TEMP TARGET $target duration: $duration " )
131
- if (target == 0.0 || duration == 0.0 ) {
131
+ if (target == 0.0 || duration == 0 ) {
132
132
val tempTarget = TempTarget ()
133
133
.date(eventTime)
134
134
.duration(0 )
@@ -145,7 +145,7 @@ class TempTargetDialog : DialogFragmentWithDate() {
145
145
.high(Profile .toMgdl(target, ProfileFunctions .getSystemUnits()))
146
146
TreatmentsPlugin .getPlugin().addToHistoryTempTarget(tempTarget)
147
147
}
148
- if (duration == 10.0 ) SP .putBoolean(R .string.key_objectiveusetemptarget, true )
148
+ if (duration == 10 ) SP .putBoolean(R .string.key_objectiveusetemptarget, true )
149
149
})
150
150
}
151
151
return true
0 commit comments