Skip to content

Data-binding #2

@ngelx

Description

@ngelx

Hi, I've got a test app with a model Trip that got some attr:

import DS from 'ember-data';
import Ember from 'ember';

export default DS.Model.extend({
  ...
  startDate: DS.attr('date'),
  endDate: DS.attr('date'),
  ....

I would like to use this addon to handle the startDate and endDate attr on trip forms, so i did something like this:

 {{flat-pickr
                  altInput=true
                  altFormat="F j, Y"
                  dateFormat="M/D/Y"
                  enableTime=true
                  hourIncrement=1
                  maxDate=trip.endDate
                  minuteIncrement=10
                  timeFormat="H:m"
                  value=trip.startDate}}

It works as expected except for 2 things.

  1. The input is not bind to the file. That mean that when I change the date using the calendar, the model field is not updated, even i've set it on the value option.
  2. Same for maxDate and minDate, the options are set ok on flatpickr init, but they are not updated when the values changes.

I'm doing something wrong? Are those features supported?

Thanks in advance
Angel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions