ng2-ui / datetime-picker

Angular2 DateTime Picker
https://ng2-ui.github.io/#/datetime-picker
MIT License
121 stars 62 forks source link

How to add Calendar Icon using span tag #130

Closed Arnpd closed 7 years ago

Arnpd commented 7 years ago

This works fine. The datepicker is shown when I click span icon. But how can I get the chosen date information?

<span class="material-icons" ng2-datetime-picker>date_range</span>

allenhwkim commented 7 years ago

Requirement is not clear. Please be more specific

Arnpd commented 7 years ago

Thank you for touch. This is my code.

<input [(ngModel)]="startDate" ng2-datetime-picker/>
<span class="material-icons" ng2-datetime-picker>date_range</span>

When I select the date on Input, the selected date would be shown in the Input. But if I select the date by Span/Button, how can I get the selected date? Thank you.

allenhwkim commented 7 years ago

Please take a look at this example from README.md https://rawgit.com/ng2-ui/ng2-datetime-picker/master/app/index.html#/component-test

Arnpd commented 7 years ago

Thank you. It was solved. Legend.

https://rawgit.com/ng2-ui/ng2-datetime-picker/master/app/index.html#/directive-test