+
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 dceae71..a62d30e 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
@@ -110,6 +110,8 @@ export class DialogBoxComponent implements OnInit {
frontDeskChoosedPractiID: any;
practiId: any;
isSubmitting: 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) {
@@ -295,6 +297,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]){
@@ -375,7 +383,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;
@@ -384,7 +392,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);
@@ -394,14 +402,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);
@@ -594,16 +602,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)
@@ -620,14 +637,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 83eb272..06724ac 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 }}