0

I am using dateTimePicker for my AngularJS application and I have set the value as below in my code.

<adm-dtp ng-model="expDate" options='{format: "YYYY-MM-DD hh:mm:00"}>
      <button class="btn date-btn" dtp-toggle>
           <i class="fa fa-calendar" aria-hidden="true"></i>
      </button>
</adm-dtp>

in my expDate variable has a value 2021-05-24 23:59:59 , but, It is display as 1970-01-01 05:30:00. I have set calType: 'gregorian' for entire of application.

please help me to identify the issue which I did ?.

K.G.K.Thilina
  • 111
  • 2
  • 11
  • What happens if you put in that date as default instead of "" ? – Kinglish May 22 '21 at 16:39
  • @Kinglish nothing , I'll remove it. but same result is shown – K.G.K.Thilina May 22 '21 at 16:46
  • Could be the AngularJS dot problem (which you'll run into at some point using ng-model without a dot). 1970-01-01 indicates that the date is empty/zero. See: https://stackoverflow.com/questions/18128323/if-you-are-not-using-a-dot-in-your-angularjs-models-you-are-doing-it-wrong – Jack A. May 23 '21 at 02:26
  • @JackA. The date is not empty. when I change calType as jalali, There is no any issue. – K.G.K.Thilina May 23 '21 at 03:27
  • Can you find both the value of the date in the controller 'expDate' and its value in `adm-dtp`'s isolate scope in ng-inspector and share it via a screenshot? – Mark Clark May 24 '21 at 19:05

0 Answers0