'use strict';
dataDashboard
  .controller('MainCtrl', ['$scope', 'Traffic',
    function ($scope, Traffic) {
      $scope.today = function() {
        $scope.dtStart = new Date().toDateString();
        $scope.dtEnd = new Date().toDateString();
      };
      $scope.format = 'yyyy-MM-dd';
      $scope.today();

      $scope.clear = function () {
        $scope.dtStart = null;
        $scope.dtEnd = null;
      };

      $scope.openStart = function($event) {
        $event.preventDefault();
        $event.stopPropagation();

        $scope.openedStart = true;
      };

      $scope.openEnd = function($event) {
        $event.preventDefault();
        $event.stopPropagation();

        $scope.openedEnd = true;
      };

      $scope.dateOptions = {
        formatYear: 'yy',
        startingDay: 1
      };

      // $scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate'];
      Traffic.query(function(data) {
        if (data) {
          $scope.trafficList = data;
          $scope.countryCount = _.countBy($scope.trafficList, 'country');
          $scope.countries = _.keys($scope.countryCount);
          $scope.visits = _.values($scope.countryCount);
          // console.log(new Date($scope.trafficList[0].timestamp*1000));
        }
      });
    }]);
@@ -167,39 +167,24 @@
 = new Date()
-.toDateString()
 ;%0A        $s
@@ -210,23 +210,8 @@
 te()
-.toDateString()
 ;%0A  
@@ -775,24 +775,193 @@
 1%0A      %7D;%0A%0A
+      $scope.$watch('%5BdtStart, dtEnd%5D', function() %7B%0A        console.log('Start date is ' + $scope.dtStart + ' while the end date is ' + $scope.dtEnd);%0A      %7D, true);%0A%0A
       // $sc

Add watch for dates