Date is not defined error in angularjs

I am trying to print a date and time in my page with values coming from an Sql Server. The format of the date that is returned is like so:



$filter('date')(date, format, timezone)  

$scope.GetTimelineByUserIdAndProjectId = function (userId, projectId) {
    var obj = { "userId": userId, "projectId": projectId }
    $'/Admin/GetTimelineByUserIdAndProjectId', obj)
    .then(function (response) {
        $scope.userTimeline =;


<ul class="timeline timeline-inverse" ng-repeat="u in userTimeline">
<li class="time-label">
    <span class="bg-red">
        {{u.StartDateTime | date:'medium'}}
    <i class="fa fa-clock-o bg-gray"></i>

I want the date format to be day/month/year hour:minutes.

When I run this program, I got the $filter is not defined so I place it in my controller like this:

var app = angular.module('adminApp', []);
app.controller('adminController', function ($scope, $http, $filter) {

but it then gives me an error of angular.js:14642 ReferenceError: date is not defined

Source: AngularJS