adopted-ember-addons / ember-moment

MIT License
399 stars 122 forks source link

global allowEmpty not respected in computed macros #221

Closed arschmitz closed 2 years ago

arschmitz commented 7 years ago

Even with the global allowEmpty set to true the computed macros still output invalid date when there is no input value

jasonmit commented 7 years ago

Yes, this is a known limitation and reflected in the README around allowEmpty. In any case, I would like to support this.

arschmitz commented 7 years ago

Maybe i'm crazy but i don't see any notes in the readme that this does not work with computed macros.

jasonmit commented 7 years ago

If null, undefined, or an empty string as a date to any of the moment helpers then you you will Invalid Date in the output. To avoid this issue globally, you can set the option allowEmpty which all of the helpers respect and will result in nothing being rendered instead of Invalid Date.

I just mention moment helpers will respect it. Feel free to correct language to avoid confusion until we land support for this.

NullVoxPopuli commented 2 years ago

computed macros have been removed in v9