From 53bd34d5baaeefe4531b40e512a0d8d9dac5c8bf Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Sat, 26 May 2018 14:26:56 +0530 Subject: [PATCH] batch list desc in broad cast --- Apollo/assets/js/controllers/sendSMSsuperadminCtrl.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Apollo/assets/js/controllers/sendSMSsuperadminCtrl.js b/Apollo/assets/js/controllers/sendSMSsuperadminCtrl.js index 09f15466..59b95e16 100755 --- a/Apollo/assets/js/controllers/sendSMSsuperadminCtrl.js +++ b/Apollo/assets/js/controllers/sendSMSsuperadminCtrl.js @@ -1,6 +1,6 @@ 'use strict'; /*** controller for Wizard Form example***/ -app.controller('sendSMSsuperadminCtrl', ["$scope", "$filter", "ngTableParams", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', function ($scope, $filter, ngTableParams, apiPoint, $http, SweetAlert, $state, md5, ipCookie) { +app.controller('sendSMSsuperadminCtrl', ["$scope", "$filter", "ngTableParams", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', 'dateListDescService', function ($scope, $filter, ngTableParams, apiPoint, $http, SweetAlert, $state, md5, ipCookie, dateListDescService) { /** * Send SMS Functionality @@ -73,6 +73,13 @@ app.controller('sendSMSsuperadminCtrl', ["$scope", "$filter", "ngTableParams", " $scope.searchData.Batch = ''; $scope.courseData = name.Course; $scope.batchData = name.Batch; + //call service for array list in desc order based on date + angular.forEach($scope.batchData,function (values,key) { + var parts = values.BatchDate.split("-"); + values.givenDateObject=new Date(parts[2], parts[1] - 1, parts[0]); + }); + $scope.batchData=dateListDescService.getOrderByList($scope.batchData); + // end $scope.OpenWindowStatus = false; $scope.getSearch(); };