adopted-ember-addons/ember-moment

ES6 moment doesn't use correct defaultFormat

leobut opened this issue · 1 comments

I have the following definition for moment in my environment.js:

moment: {
      includeLocales: ['is'],
      outputFormat: 'YYYY-MM-DDTHH:mm:ss'
}

The outputFormat is correctly applied to {{moment-format}}, but not to the moment object that can be used in ES6.

I import the moment object like this import moment from 'moment'; and use it like this in an action inside a component this.set('data.myDateAsString', moment(dateObjectFromUi).format());. The output that I get is formatted in the original default format and not in the default format that I defined in the environment.js.

Used Versions:

  • "ember-moment": "^7.8.0"
  • "ember-cli": "^3.5.1"

outputFormat config option is used only in helpers and computeds. Not when interfacing with the moment API directly. This is behaving as expected.