1

I am trying to set date in input type date using angular.js

js:

$scope.fromDate=new Date("1995-12-12");

html:

<input class="{{direction}}" type="date" name="fromDate" ng-model="fromDate"   value="{{fromDate}}">

It works fine in desktop but doesn't work in ipad. Does somebody know why?

Tuvia Khusid
  • 792
  • 5
  • 15
  • 31

1 Answers1

0

Safari doesn't understand new Date("1995-12-12"); See: Invalid date in safari

also:

http://biostall.com/javascript-new-date-returning-nan-in-ie-or-invalid-date-in-safari for formats that do work

Community
  • 1
  • 1
Jen
  • 1
  • 1