angular.module('myApp').controller('timeSheetReportController' , function ($scope , $http) {

    $scope.request = {
        "currentDate": ""
    };


    $scope.timeSheetList = function(pro) {
        var date = new Date();
        $scope.request.currentDate = date.getFullYear() + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + '-' + ('0' + date.getDate()).slice(-2);
        $http({
            method: 'GET',
            url: "http://localhost:8081/admin/report/project/"+pro.id+"/timeSheet/"+$scope.request.currentDate

        }).then(function successCallback(response) {
            console.log(response);
            $scope.timeSheets= response.data;
            console.log($scope.timeSheets);
        }, function errorCallback(response) {
            console.log(response)
        });
    }
});
