ADM-dateTimePicker icon indicating copy to clipboard operation
ADM-dateTimePicker copied to clipboard

Typing a date, when no default date is specified generates the error "Cannot read property 'unix' of undefined"

Open jeffersonmeyer opened this issue 8 years ago • 1 comments

Hi, I have the following scenario:

If I type a date instead of selecting one from the picker, it gives me the following error:

Cannot read property 'unix' of undefined at m.t.modelChanged (ADM-dateTimePicker.min.js:11) at fn (eval at compile (angular.js:14138), :4:227) at b (angular.js:15151) at e (angular.js:24674) at m.$eval (angular.js:16895) at m.$apply (angular.js:16995) at HTMLInputElement. (angular.js:24679) at HTMLInputElement.dispatch (jquery-2.2.1.js:4732) at HTMLInputElement.elemData.handle (jquery-2.2.1.js:4544)

Tks.

Jefferson

jeffersonmeyer avatar Apr 04 '17 12:04 jeffersonmeyer

I got that error too. Workaround: init the fulldata property <adm-dtp ng-model="date" full-data="date_details"></adm-dtp>

in js, init the date_details property (doesn't need to be real values)

date_details = {
          formated: "",
          gDate: "",
          unix: 0,
          year: 0,
          month: 0,
          day: 0,
          hour: 0,
          minute: 0,
          minDate: null,
          maxDate: null,
          calType: "gregorian",
          format: "DD/MM/YYYY"
      }

didier-v avatar May 18 '17 05:05 didier-v