Angular date filter in range Examples

Angular date filter in range

Today, We want to share with you Angular date filter in range.
In this post we will show you Angular date filter in range, hear for Angular date filter in range we will give you demo and example for implement.
In this post, we will learn about Angular date filter in range with an example.

I want to some records display data in range of input date by two inputs of date. (AngularJS simple date filter in range by two inputs HTML elements.)

Filter a used on a specific date range.The date filter formats a date to a specified format display.

READ :  vue js Login Form get http json data

Syntax Date Filter

 {{ date | date : format : timezone }}

The date can be a simple date object Like as a milliseconds format, or a datetime string like “2019-02-08T06:05:05.035Z”

Example of ng-repeat filtering data by date range


<!DOCTYPE html>
    <script src=""></script>
    <script src="script.js"></script>
  <body ng-app="ndApp" ng-controller="dateCtrl">
      <input type="text" class="form-control" lanname="from" ng-model="from">
  <input type="text" class="form-control" lanname="to" ng-model="to"> 
        <table border="1">
                <td>Unique ID</td>
            <tr ng-repeat="data in  lanlist | dateRange : from : to">
                <td> {{data.languagesId}}</td>
                <td> {{data.LanName}}</td>
                <td> {{data.isactive}}</td>
                <td> {{data.Date}}</td>


var ng4app = angular.module('ndApp',[]).controller('dateCtrl', function($scope){
  $scope.from = '05/02/2019';
  $ = '05/04/2019';
            $scope.lanlist = [
                 {languagesId : 'pp-12', LanName : 'laravel', isactive : 'Approved', Date:'05/01/2019' },
                 {languagesId : 'pp-11', LanName : 'laravel', isactive : 'Canceled', Date:'05/02/2019' },
                 {languagesId : 'pp-45', LanName : 'Javascript', isactive : 'Pending', Date:'05/03/2019' },
                 {languagesId : 'pp-32', LanName : 'Thomas', isactive : 'Canceled', Date:'05/04/2019' },
                 {languagesId : 'pp-01', LanName : 'Thomas', isactive : 'Pending', Date:'05/05/2019' },
                 {languagesId : 'pp-09', LanName : 'Javascript', isactive : 'Approved', Date:'05/06/2019' },
                 {languagesId : 'pp-23', LanName : 'vuejs', isactive : 'Requested', Date:'05/07/2019'},
                 {languagesId : 'pp-39', LanName : 'laravel', isactive : 'Pending', Date:'05/08/2019' }
         .filter('dateRange', function() {
        return function(lanlists, from, to) {
            return lanlists.filter(function(lanlist) {
                return lanlist.Date >= from && lanlist.Date <= to;

Angular 6 Example

Angular Latest My Previous Post With Source code

  1. Angular 6 Folder Project Structure
  2. Angular 6 CLI Installation
  3. Angular 6 Module File
  4. Angular 6 Components
  5. Angular 6 Services
  6. Angular 6 Routing
  7. Angular 6 CSS
  8. Angular 6 Class Binding
  9. Angular 6 Animation
  10. Angular 6 Templating
  11. Angular 6 HTTP Client
READ :  AngularJS Datepicker Directives Example with Source Code

View Demo

Add a Comment

Your email address will not be published. Required fields are marked *