Skip to content

Commit 5e51e4b

Browse files
unknownunknown
authored andcommitted
#5-08-2024
1 parent 9b24922 commit 5e51e4b

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

appsTeacher/groups/app.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ module.exports = function init(site) {
325325
let index = doc.dayList.findIndex(
326326
(itm) => new Date(itm.date).getDate() === date.getDate() && new Date(itm.date).getMonth() === date.getMonth() && new Date(itm.date).getFullYear() === date.getFullYear() && !itm.isBook
327327
);
328-
console.log(doc.dayList);
329328

330329
if (index !== -1) {
331330
if (!doc.dayList[index].isBook) {

appsTeacher/groups/site_files/js/index.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)