Skip to content

Commit

Permalink
Check for empty value in date-time-picker
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Novy committed Sep 28, 2017
1 parent a4cb6e6 commit 403fef1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addon/components/date-time-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export default Component.extend({
actions: {
updateDate(val) {
let oldDate = get(this, '_value');
if (oldDate) {
if (oldDate && val) {
val.hours(oldDate.hours());
val.minutes(oldDate.minutes());
val.seconds(oldDate.seconds());
Expand All @@ -259,7 +259,7 @@ export default Component.extend({
updateTime(val) {
let oldDate = get(this, '_value');

if (oldDate) {
if (oldDate && val) {
val.year(oldDate.year());
val.month(oldDate.month());
val.date(oldDate.date());
Expand Down

0 comments on commit 403fef1

Please sign in to comment.