Is it possible to make the date dynamically change in the link?

For example, today is 10/11/2016 and you need to enter the date in the link

like for example here: start=20161011&finish20161011

Well, also identical for the week of the month and year.

 var CupApp = angular.module('CupApp', []); CupApp.controller('CupCtrl', function ($scope, $http){ $http.get('http://buff:123@192.168.0.7:8080/pt/hs/buffnew/total?start=20160101&finish=20161231').success(function(data) { $scope.cups = data; }); }); 

  • There is no solution to this issue? - heymukki

1 answer 1

 var date = new Date(), year = date.getFullYear(), month = date.getMonth(), day = date.getDate(), fullDate = '' + year + (month + 1) + day; $http.get('http://buff:123@192.168.0.7:8080/pt/hs/buffnew/total?start=' + fullDate + '&finish=' + fullDate).success(function(data) { 
  • Failed to download resource: the server responded with a status of 404 (Not Found) - heymukki
  • Not working unfortunately = ( - heymukki
  • @heymukki, maybe the problem was not in the client, but in how the server handled this request? and really for such values ​​returned 404 error? - Grundy