1

I use this dateTime- Picker and I have the problem that I can not set a date with formate dd.MM.yyyy into my model iuc.scheduleAbsenceHeader.activationDate. If I am doing this, I get the error:

Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.

Has anyone any idea how I can solve this?

<input type="text"
       class="form-control"
       name="systemEntryDate"                                
       ng-model="iuc.scheduleAbsenceHeader.activationDate"
       ng-change="vm.updateScheduleAbsenceHeader(iuc)"
       datepicker-popup="dd.MM.yyyy"
       is-open="iuc.scheduleAbsenceHeader.openedDatePicker"
       close-text="schlie&szlig;en"
       current-text="heute"
       clear-text="l&ouml;schen">
<span class="input-group-btn">
 <button type="button" class="btn btn-default"                                 
         ng-click="vm.openDatePickerSystemEntry($event, institutionUserConnection)"><span
         class="glyphicon glyphicon-calendar"></span></button>

quma
  • 5,233
  • 26
  • 80
  • 146

1 Answers1

0

Using moment.js I can successfully set a dateTime picker's value to the current dateTime like so:

vm.myDate = moment((moment().toISOString())).format("MM.DD.YYYY")

Otherwise, have a look at this post.

Community
  • 1
  • 1
BBauer42
  • 3,549
  • 10
  • 44
  • 81