christopheclc / polymer-date-picker

A Polymer interpretation of Dan Grossman's awesome bootstrap-daterangepicker (https://github.com/dangrossman/bootstrap-daterangepicker)
BSD 2-Clause "Simplified" License
36 stars 16 forks source link

Multiple? #4

Open mikecann opened 9 years ago

mikecann commented 9 years ago

How do you get this to work with multiple date pickers on the same page? It only seems to show one input..

christopheclc commented 9 years ago

Hey Mike,

You should be able to include multiple on the same page by providing multiple inputs. The date range picker is meant to bind to any relatedTarget attribute you provide.

So for example:

<input id="trigger" value="{{selectedDate}}" on-click="{{$.datePicker.toggle}}" readonly class="date"/><polymer-date-picker id="datePicker" selectedDate="{{selectedDate}}" relatedTarget="{{$.trigger}}" opened="false"/>

<input id="trigger2" value="{{selectedDate2}}" on-click="{{$.datePicker2.toggle}}" readonly class="date"/><polymer-date-picker id="datePicker2" selectedDate="{{selectedDate2}}" relatedTarget="{{$.trigger2}}" opened="false"/>

Let me know if that doesn't work.

On Wed, Oct 22, 2014 at 2:32 AM, Mike Cann notifications@github.com wrote:

How do you get this to work with multiple date pickers on the same page? It only seems to show one input..

— Reply to this email directly or view it on GitHub https://github.com/christopheclc/polymer-date-picker/issues/4.

mikecann commented 9 years ago

Nope, you only seem to get one input: image