fooloomanzoo / datetime-picker

A minimal picker for date and time for Polymer, that can use the native input
MIT License
78 stars 18 forks source link

Initializing by attribute doesn't work #25

Closed redosk closed 6 years ago

redosk commented 6 years ago

I am trying to initialize the date in a element by binding its date attribute to my element date attribute, its date is always set to today. If I change my date attribute after rendering, it works.

my-test.html :

<dom-module id="my-test" attributes="date">
    <template>
        <overlay-date-picker auto-confirm id="echeancepicker" date="{{date}}"></overlay-date-picker>
        <div>[[date]]</div>
    </template>
    <script>
        Polymer({
            is: "my-test",
            properties: {
                date: {
                    type: String,
                    reflectToAttribute: true,
                    notify: true
                }
            }
        });
    </script>
</dom-module>

blabla.html :

....
<my-test date="2016-02-03"></my-test>
....
fooloomanzoo commented 6 years ago

The new update fixes the issue