I'm fairly new to javascript and angularjs so please bear with me. I am having issues when attempting to interact with the Date object. I assume that Date is a javascript object. However when running .getDate() on a Date object i get a date of 1970.
My code is shown below:
(function() {
var app = angular.module("app", []);
var DateController = function($scope) {
$scope.today = new Date();
$scope.tomorrow = $scope.today.getDay() +1;
};
app.controller("DateController", DateController);
}());
This is really basic, however l do not understand why I am getting that date. I also get the same behavior when working with some other default javascript Date functions. An explanation would also be appreciated.
I have created a plunk for convience: Take me to the plunk!