angularjs - How to check current date and system date are same? -
i using code:
<md-datepicker ng-model="reviewdate" md-placeholder="review date*" md-min-date="currdate" md-max-date="maxdate" ng-focus="createalpctrl.errors.review_date = ''">
$scope.currdate = new date(); $scope.maxdate = new date( $scope.currdate.getfullyear(), $scope.currdate.getmonth() + 3, $scope.currdate.getdate());
it giving correct values when local system date correct. when changing local system date other date showing wrong date current date.
how can overcome this?
i retrieved server date server side code , using server date, set min , max date.
server code :
meteor.methods({ currentdate: function() { let currdate = new date(); return currdate } })
client code :
meteor.call('currentdate', function(error, result) { if (error) { console.log(error); } else { console.log(result); $scope.currdate = result; } });
it working fine.
Comments
Post a Comment