How to use date picker with ember


#1

I need to include date picker in my form, i installed pickaday addon and aaded it to my template.

how can i get the value of it from template and manipulate it.

i tried this

{{pikaday-input value=pickaday format=“MM/DD/YYYY” class=“form-control” }}

let date = this.get(“pickaday”);


#2

Can you give a little more information? Are you trying to do this from a component template? Or elsewhere? Can you include any relevant code?


#3

I use ember-cli-bootstrap-datepicker that uses Javascript native Date objects instead of ISO date strings. It seem pikaday-input works the same way. Just set startDate on te component or controller like this and you can manipulate it.

In the template:

{{pikaday-input value=startDate format='DD.MM.YYYY'}}
{{startDate}}