Developing an android app with a search function that includes input type date. Attempted to parse the input date from 2017-5-10T17:00:00.000Z
to 2017-5-10
using moment.angular. Although the search function works, it results in an error that prevents the app from moving to another page, leaving it stuck on the search page. The source of the error is unknown.
Here is the HTML code being used:
<label class="item item-input">
<span class="input-label">Start</span>
<input type="date" ng-model="trip.start">
</label>
And this is the controller code being implemented:
$scope.trip.start = moment($scope.trip.start).format("YYYY-MM-DD");
An additional script has been added to the index:
<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.1/moment.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.min.js"></script>
Your assistance in resolving this issue would be greatly appreciated.
Thank you.