Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Falsy second parameter for moment-format doesn't use default format #284

Open
balinterdi opened this issue Jul 31, 2018 · 0 comments
Open

Comments

@balinterdi
Copy link

balinterdi commented Jul 31, 2018

Maybe I'm wrong but if the value of the second parameter passed to moment-format is a falsy value, I'd expect the date to be displayed in the default format.

That's currently not the case as the code checks the number of parameters passed explicitly and only uses moment.outputFormat (the default format set in the configuration):
https://github.com/stefanpenner/ember-moment/blob/v7.7.0/addon/helpers/moment-format.js#L28-L35

If it worked as I describe, the following:

{{#with currentUser.user.dateFormat as |format|}}
  {{moment-format date format}}
{{else}}
  {{moment-format date}}
{{/with}}

could be written as:

{{moment-format date format}}

Is this the intended behavior or can we get the default format in the case I described?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant