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

altFormat not binded? #255

Closed
Techn1x opened this issue Jul 6, 2018 · 3 comments · Fixed by #256
Closed

altFormat not binded? #255

Techn1x opened this issue Jul 6, 2018 · 3 comments · Fixed by #256

Comments

@Techn1x
Copy link
Contributor

Techn1x commented Jul 6, 2018

I have something like this

Template

{{ember-flatpickr
  allowInput=true
  altFormat=altFormat
  altInput=true
  date=(readonly (moment-format startDate))
  model='single'
  onChange=(action 'startDateChanged')
}}

Controller

altFormat: computed('startDate', function() {
  let startDate = this.get('startDate');
  let result = (startDate.someCondition) ? "j M (h:iK)" : "j M (h:iK) Y";

  console.log(result);
  return result;
}),

Basically, altFormat is definitely being changed when it is meant to, but the string displayed in the flatpickr input is not changing to the new altFormat string.

https://ember-twiddle.com/3a64d259966a1494315cd20ead8b4959?openFiles=controllers.application.js%2C

Should it be binded? If not, is there a way I can still do this?

Thanks

@RobbieTheWagner
Copy link
Owner

It's not currently one of the things we update. It could potentially be added though. It would need to be added here https://github.com/shipshapecode/ember-flatpickr/blob/master/addon/components/ember-flatpickr.js#L53

@Techn1x
Copy link
Contributor Author

Techn1x commented Jul 6, 2018

Cool, thanks for that, I'll submit a PR when I get some free time

@Techn1x
Copy link
Contributor Author

Techn1x commented Jul 8, 2018

#256

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

Successfully merging a pull request may close this issue.

2 participants