@@ -268,7 +268,7 @@ app.controller("groups", function ($scope, $http, $timeout) {
268268 $scope . busy = false ;
269269 if ( response . data . done && response . data . list . length > 0 ) {
270270 if ( ! $scope . item . studentList . some ( ( k ) => k . student && k . student . id === response . data . list [ 0 ] . id ) ) {
271- $scope . item . studentList . unshift ( { student : response . data . list [ 0 ] , attend : false , discount : 0 , discountValue : 0 , requiredPayment : $scope . item . price } ) ;
271+ $scope . item . studentList . unshift ( { student : response . data . list [ 0 ] , attend : false , discount : 0 , discountValue : 0 , requiredPayment : $scope . item . price } ) ;
272272 } else {
273273 $scope . error = "##word.Student Exist##" ;
274274 }
@@ -450,6 +450,7 @@ app.controller("groups", function ($scope, $http, $timeout) {
450450 if ( item . startDate && item . endDate ) {
451451 let start = new Date ( item . startDate ) ;
452452 let end = new Date ( item . endDate ) ;
453+ end . setHours ( 0 , 0 , 0 , 0 ) ;
453454 item . dayList = [ ] ;
454455 let index = item . days . findIndex ( ( itm ) => itm . code === start . getDay ( ) ) ;
455456 if ( index !== - 1 ) {
@@ -459,9 +460,11 @@ app.controller("groups", function ($scope, $http, $timeout) {
459460 start . setTime ( start . getTime ( ) + 1 * 24 * 60 * 60 * 1000 ) ;
460461 let index = item . days . findIndex ( ( itm ) => itm . code === start . getDay ( ) ) ;
461462 if ( index !== - 1 && new Date ( start ) <= new Date ( end ) ) {
462- item . dayList . push ( { date : new Date ( start ) , day : item . days [ index ] } ) ;
463+ let _start = new Date ( start ) ;
464+ _start . setHours ( 0 , 0 , 0 , 0 ) ;
465+ item . dayList . push ( { date : _start , day : item . days [ index ] } ) ;
463466 }
464- if ( new Date ( start ) == new Date ( end ) ) {
467+ if ( new Date ( _start ) == new Date ( end ) ) {
465468 break ;
466469 }
467470 }
@@ -471,6 +474,7 @@ app.controller("groups", function ($scope, $http, $timeout) {
471474 $scope . changeDay = function ( item ) {
472475 $scope . error = "" ;
473476 item . date = new Date ( item . date ) ;
477+ item . date . setHours ( 0 , 0 , 0 , 0 ) ;
474478 let index = $scope . weekDaysList . findIndex ( ( itm ) => itm . code === item . date . getDay ( ) ) ;
475479 if ( index !== - 1 ) {
476480 item . day = $scope . weekDaysList [ index ] ;
@@ -567,7 +571,7 @@ app.controller("groups", function ($scope, $http, $timeout) {
567571 $scope . error = "##word.This Month Is Exist##" ;
568572 return ;
569573 }
570- item . paymentList . unshift ( { date : item . $date , price : item . $price , month : item . $month , remain : item . $remain , paymentList : [ { date : new Date ( ) , price : item . $price } ] } ) ;
574+ item . paymentList . unshift ( { date : item . $date , price : item . $price , month : item . $month , remain : item . $remain , paymentList : [ { date : new Date ( ) , price : item . $price } ] } ) ;
571575 delete item . $price ;
572576 delete item . $month ;
573577 delete item . $remain ;
0 commit comments