diff --git a/app/assets/javascripts/app/controllers/_ui_element/date.js.coffee b/app/assets/javascripts/app/controllers/_ui_element/date.js.coffee index f082d2329..8444f45f4 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/date.js.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/date.js.coffee @@ -65,8 +65,8 @@ class App.UiElement.date item @format: (number) -> - if parseInt(number) < 10 - number = "0#{number}" + if number isnt '' && Number(number) < 10 + number = "0#{Number(number)}" number @setNewTime: (item, attribute, diff, reset = false, tolerant = false) -> diff --git a/app/assets/javascripts/app/controllers/_ui_element/datetime.js.coffee b/app/assets/javascripts/app/controllers/_ui_element/datetime.js.coffee index e9c854988..ec3619cb2 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/datetime.js.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/datetime.js.coffee @@ -79,8 +79,8 @@ class App.UiElement.datetime item @format: (number) -> - if parseInt(number) < 10 - number = "0#{number}" + if number isnt '' && Number(number) < 10 + number = "0#{Number(number)}" number @setNewTime: (item, attribute, diff, reset = false, tolerant = false) ->