diff --git a/addons/core/addon/helpers/relative-datetime-live.js b/addons/core/addon/helpers/relative-datetime-live.js index 746f89643..831611cb1 100644 --- a/addons/core/addon/helpers/relative-datetime-live.js +++ b/addons/core/addon/helpers/relative-datetime-live.js @@ -45,6 +45,8 @@ export default class extends Helper { // =methods compute([date]) { + if (!date) return; + const delta = date.valueOf() - this.clockTick.now; const greatestMeaningfulUnit = unitMappings.reduce( (currentValue, previousValue) => { diff --git a/addons/core/tests/integration/helpers/relative-datetime-live-test.js b/addons/core/tests/integration/helpers/relative-datetime-live-test.js index e7e120e2c..39412a8dd 100644 --- a/addons/core/tests/integration/helpers/relative-datetime-live-test.js +++ b/addons/core/tests/integration/helpers/relative-datetime-live-test.js @@ -53,4 +53,12 @@ module('Integration | Helper | relative-datetime-live', function (hooks) { await render(hbs`{{relative-datetime-live this.date}}`); assert.dom(this.element).hasText('in 22 years'); }); + + test('it renders nothing when there is no date', async function (assert) { + assert.expect(1); + + this.date = null; + await render(hbs`{{relative-datetime-live this.date}}`); + assert.dom(this.element).hasText(''); + }); }); diff --git a/ui/admin/app/components/form/worker/index.hbs b/ui/admin/app/components/form/worker/index.hbs index 6c7115f05..009ef1326 100644 --- a/ui/admin/app/components/form/worker/index.hbs +++ b/ui/admin/app/components/form/worker/index.hbs @@ -99,7 +99,10 @@