Skip to content

Commit

Permalink
BH-75889 - Use correct comparison for dates in time picker input (#1304)
Browse files Browse the repository at this point in the history
Co-authored-by: kristian.robe <[email protected]>
  • Loading branch information
robek2020 and kristian.robe authored May 19, 2022
1 parent 377bb96 commit 58237ec
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,12 @@ export class NovoTimePickerInputElement implements OnInit, OnChanges, ControlVal
}

onComplete(dt) {
if (this.value !== dt) {
if (this.value instanceof Date && dt instanceof Date) {
if (this.value.getTime() !== dt.getTime()) {
this.dispatchOnChange(dt);
}
}
else if (this.value !== dt) {
this.dispatchOnChange(dt);
}
}
Expand Down

0 comments on commit 58237ec

Please sign in to comment.