If you need to use Bootstrap Datepicker component in your Ember.js application the code shown below will help you.
- First of all you have to create new View object:
- And then insert it into your template:
App.DatePickerView = Ember.TextField.extend
_valueChanged: Em.observer 'value', ->
value = moment(@get('value'), 'DD.MM.YYYY HH:mm')
@$().data("DateTimePicker").setDate(value)
return
didInsertElement: ->
@$().datetimepicker
format: 'DD.MM.YYYY HH:mm'
return
{{view App.DateField value=mydate}}
Keine Kommentare:
Kommentar veröffentlichen