+
diff --git a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.ts b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.ts
index d067865..a84414e 100644
--- a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.ts
+++ b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.ts
@@ -112,6 +112,8 @@ export class DialogBoxComponent implements OnInit {
isSubmitting: boolean = false;
selectedRadioValue: any;
paymentMode: boolean = false;
+ slotIndex_group:any=[];
+ slotslength:any=[];
constructor(private notifierService: NotifierService,private router: Router,private formBuilder: FormBuilder, public _cus:CustomersService,
public dialogRef: MatDialogRef,public _api:ConsultantService, public _con:ConsultantService,
@Inject(MAT_DIALOG_DATA) public data: UsersData,public _app:AppointmentsService,public end_user:EndUserService) {
@@ -296,6 +298,12 @@ export class DialogBoxComponent implements OnInit {
console.log(res)
let data = res['data'];
this.slots = data
+ let len =[]
+ this.slots.forEach(element => {
+
+ len.push( element.length)
+ })
+ console.log(len)
// this.slots.forEach(element => {
// console.log(element)
// if(element == this.findSlotIndex[0]){
@@ -376,7 +384,7 @@ export class DialogBoxComponent implements OnInit {
})
}
- checkSlotDur(param:any,i:any){
+ checkSlotDur(param:any,i:any,slots){
//console.log(param,i)
// this.slot_array =[];
// debugger;
@@ -385,7 +393,7 @@ export class DialogBoxComponent implements OnInit {
// this.slotTime = param
// console.log(this.date,param)
- let thirtyMinutes = this.duration * 60 * 1000; // convert 30 minutes to milliseconds
+ let thirtyMinutes = this.duration * 60000; // convert 30 minutes to milliseconds
let date1 = new Date(param);
let date2 = new Date(date1.getTime() + thirtyMinutes);
// console.log(date1);
@@ -395,14 +403,14 @@ export class DialogBoxComponent implements OnInit {
const rangeDate = new Date(date2);
- const resultArray = this.slots.filter(slot => {
+ const resultArray = slots.filter(slot => {
const date = new Date(slot);
return date >= rangeDate;
});
const firstSlt = new Date(date1);
const lastSlt = new Date( resultArray[0]);
- const filteredTimes = this.slots.filter(time => new Date(time) >= firstSlt && new Date(time) <= lastSlt);
+ const filteredTimes = slots.filter(time => new Date(time) >= firstSlt && new Date(time) <= lastSlt);
// console.log(resultArray,filteredTimes);
@@ -595,16 +603,25 @@ console.log(params)
console.log(res)
let data = res['data'];
this.slots = data
+ let len =[];
+ this.slots.forEach(element => {
+
+ len.push( element.length)
+ })
+ console.log(len)
+
+ this.slotslength = len.reduce((a, b) => a + b, 0)
}
})
}
- toggleActive(event:any,param:any,i:any){
+ toggleActive(event:any,param:any,i:any,slots,j){
console.log(event,param,i)
this.slot_array =[];
+ this.slotIndex_group=j
// debugger;
// // event.preventDefault();
- this.slotIndex = i
+ this.slotIndex = param
// this.slotTime = param
let resultDate = new DatePipe('en-US').transform(param, 'shortTime')
this.form.controls['appoinmentTime'].setValue(resultDate)
@@ -621,14 +638,14 @@ console.log(params)
const rangeDate = new Date(date2);
- const resultArray = this.slots.filter(slot => {
+ const resultArray =slots.filter(slot => {
const date = new Date(slot);
return date >= rangeDate;
});
const firstSlt = new Date(date1);
const lastSlt = new Date( resultArray[0]);
- const filteredTimes = this.slots.filter(time => new Date(time) >= firstSlt && new Date(time) <= lastSlt);
+ const filteredTimes = slots.filter(time => new Date(time) >= firstSlt && new Date(time) <= lastSlt);
console.log(resultArray,filteredTimes);
// if(filteredTimes.length > 1){
diff --git a/ng-seed/src/app/end-user/booking-summary/booking-summary.component.html b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.html
index f0eb116..30c0d14 100644
--- a/ng-seed/src/app/end-user/booking-summary/booking-summary.component.html
+++ b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.html
@@ -79,7 +79,7 @@
Booked On
- : {{bookingSummary.createdAt2 | date:'dd/MM/yyyy'}}
+ : {{bookingSummary.createdAt2 }}