diff --git a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html index deec42b..96f8bd3 100644 --- a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html +++ b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html @@ -29,52 +29,95 @@ + + + + + -
Client Name {{row.customer[0].cusName || null }}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date and Time {{row.appoinmentDate | date:'dd-MMM-YYYY'}}, {{row.appoinmentSlots[0] | date:'shortTime'}} Mobile no {{row.customer[0].phoneNo}} Email {{row.customer[0].email}} Client Address {{row.customer[0].address_1}}, {{row.customer[0].city}}, {{row.customer[0].state}} Status {{row.status == 0 ? 'Booked':'Cancelled'}} Action
+ + + - + {{row.index+1}} + - + + Date and Time {{row.appoinmentDate | date:'dd-MMM-YYYY'}}, {{row.appoinmentSlots[0] | date:'shortTime'}} - + Mobile No {{row.customer[0].phoneNo}} - + Email {{row.customer[0].email}} - + Client Address {{row.customer[0].address_1}}
{{row.customer[0].city}}
{{row.customer[0].state}}
- + Status {{row.status == 0 ? 'Booked':'Cancelled'}} - + Action @@ -86,8 +129,7 @@ - - + --> { return b.id - a.id; + }); + filter.forEach((element, index) => { + element.index = index + + }); this.appointmentListSource['data'] = filter this.appointmentListLength = filter.length; @@ -168,6 +173,11 @@ export class AppoinmentsListComponent implements OnInit { console.log(this.appointmentListLength) this.appoinmentsList.sort((a: any, b: any) => { return b.id - a.id; + }); + this.appoinmentsList.forEach((element, index) => { + element.index = index + + }); this.appointmentListSource['data'] = this.appoinmentsList; console.log(this.appointmentListSource) diff --git a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html index 05b23c5..3aaa7ad 100644 --- a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html +++ b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html @@ -75,7 +75,7 @@
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 74f8c0f..3ca021e 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 @@ -39,7 +39,8 @@ export class DialogBoxComponent implements OnInit { local_data:any; url: string | ArrayBuffer; heroes = ['Windstorm', 'Bombasto', 'Magneta', 'Tornado']; - + days: any=[]; + dayName:any=[]; busname = new FormControl('', [Validators.required]); name = [ @@ -160,6 +161,16 @@ export class DialogBoxComponent implements OnInit { // }) this.user_role = localStorage.getItem('user_role'); + let tmp=[] + for(let i=0;i<=5;i++){ + var someDate = new Date(); + someDate.setDate(someDate.getDate() + i); //number of days to add, e.x. 15 days + var dateFormated = someDate.toISOString().substr(0,10); + console.log(dateFormated); + tmp.push(dateFormated) + } + console.log(tmp) + this.days= tmp this.getSlots() if(this.user_role != 'FRONTDESK'){ let userId = localStorage.getItem('user_id') @@ -186,8 +197,27 @@ export class DialogBoxComponent implements OnInit { }); console.log(this.local_data, this.selects) + // this.local_data.forEach(element => { + if(this.local_data.hasOwnProperty('action')){ + + + if(this.local_data.action != 'Add'){ + this.local_data.service = this.local_data['ServicesMapDetail.serviceId'] + this.ServiceId = this.local_data.service + this.local_data.customer = this.local_data.customer[0].id + this.customerId = this.local_data.customer + this.slotsResult =this.local_data.appoinmentSlots + + console.log(this.servicesList_array) + } + + } + + + // }); // this.form.controls['note'].setValue('Sample') this.form.patchValue(this.local_data) + let id = localStorage.getItem('user_id') console.log(id) this._con.getUsersListDetails(id).subscribe(res => { @@ -237,7 +267,7 @@ export class DialogBoxComponent implements OnInit { this.end_user.CreatecusServicesMapDetails(paramsmap).subscribe(res => { if (res.status == 200) { let serviceMap = res['data'][0].id - let paramsData= { + let paramsData:any= { "busId": localStorage.getItem('busId'), "cusId": this.customerId, "appoinmentDate": this.form.value.appoinmentDate, @@ -246,10 +276,24 @@ export class DialogBoxComponent implements OnInit { "appoinmentSlots": this.slotsResult, //"servicemap" :this.bookedAppointment_servicemap } + if(this.local_data.hasOwnProperty('id')){ + paramsData.id =this.local_data.id + } console.log(paramsData) this._app.addFormDetails(paramsData).subscribe(res => { if (res.status == 200) { - this.notifierService.notify('success', 'Appointment Added Successfully'); + + if(this.local_data.hasOwnProperty('action')){ + + + if(this.local_data.action != 'Add'){ + this.notifierService.notify('success', 'Appointment Rescheduled Successfully'); + }else{ + this.notifierService.notify('success', 'Appointment Added Successfully'); + } + }else{ + this.notifierService.notify('success', 'Appointment Added Successfully'); + } this.dialogRef.close(0); } }) @@ -263,12 +307,50 @@ export class DialogBoxComponent implements OnInit { if(this.clicks <5){ this.clicks += 1; } + console.log( this.clicks) + console.log(this.days,this.days[ this.clicks], this.clicks) + + let options:any = { weekday: 'long'}; + var prnDt = new Date(this.days[ this.clicks]).toLocaleTimeString('en-us', options); + var formatDate = prnDt.split(" ") + console.log(formatDate) + + this.dayName = formatDate[0] + let userId = localStorage.getItem('user_id') + let params ={"id":userId , "day": this.dayName , "addcount": this.clicks} + + this.end_user.getSlots(params).subscribe(res => { + if (res.status == 200) { + console.log(res) + let data = res['data']; + this.slots = data + } + }) } goToSlotBooking2(){ // this.days[] - if( this.clicks >0){ + if(this.clicks >0){ this.clicks -= 1; } + console.log( this.clicks) + console.log(this.days,this.days[ this.clicks], this.clicks) + + let options:any = { weekday: 'long'}; + var prnDt = new Date(this.days[ this.clicks]).toLocaleTimeString('en-us', options); + var formatDate = prnDt.split(" ") + console.log(formatDate) + + this.dayName = formatDate[0] + let userId = localStorage.getItem('user_id') + let params ={"id":userId , "day": this.dayName , "addcount": this.clicks} + + this.end_user.getSlots(params).subscribe(res => { + if (res.status == 200) { + console.log(res) + let data = res['data']; + this.slots = data + } + }) console.log( this.clicks) } check(param){ @@ -304,7 +386,8 @@ export class DialogBoxComponent implements OnInit { let resultDate = new DatePipe('en-US').transform(param, 'shortTime') this.form.controls['appoinmentTime'].setValue(resultDate) this.date= param - console.log(this.date,param,this.duration) + + console.log(this.date,param,this.duration, this.ServiceId) let thirtyMinutes = this.duration * 60 * 1000; // convert 30 minutes to milliseconds let date1 = new Date(param); let date2 = new Date(date1.getTime() + thirtyMinutes); @@ -354,6 +437,9 @@ export class DialogBoxComponent implements OnInit { }); }); console.log(this.servicesList_array) + this.servicesList_array.filter(arr=>{return arr.serviceId == this.local_data['ServicesMapDetail.serviceId']}) + + this.duration = this.servicesList_array[0].duration } // this.getAssignedList(this.usersList.busId) }); @@ -427,5 +513,8 @@ customerIdvalue(id){ console.log(id) this.customerId = id } + + + } diff --git a/ng-seed/src/app/appoinment/business/add-business/add-business.component.html b/ng-seed/src/app/appoinment/business/add-business/add-business.component.html index 6d048e4..75f64d8 100644 --- a/ng-seed/src/app/appoinment/business/add-business/add-business.component.html +++ b/ng-seed/src/app/appoinment/business/add-business/add-business.component.html @@ -25,6 +25,7 @@ + Phone No Contact No is required Invalid Contact No diff --git a/ng-seed/src/app/appoinment/business/business-list/business-list.component.html b/ng-seed/src/app/appoinment/business/business-list/business-list.component.html index 3de8b1a..8ce2a48 100644 --- a/ng-seed/src/app/appoinment/business/business-list/business-list.component.html +++ b/ng-seed/src/app/appoinment/business/business-list/business-list.component.html @@ -20,7 +20,7 @@ S.No - {{row.id}} + {{row.index+1}} @@ -49,7 +49,7 @@ - Action + Action edit delete diff --git a/ng-seed/src/app/appoinment/business/business-list/business-list.component.scss b/ng-seed/src/app/appoinment/business/business-list/business-list.component.scss index fd9c48f..a14f574 100644 --- a/ng-seed/src/app/appoinment/business/business-list/business-list.component.scss +++ b/ng-seed/src/app/appoinment/business/business-list/business-list.component.scss @@ -123,4 +123,7 @@ img { } .mat-mob{ width: 15%; + } + .mat-action{ + width: 10%; } \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts b/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts index c9ef6e2..029bf03 100644 --- a/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts +++ b/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts @@ -66,6 +66,11 @@ export class BusinessListComponent implements OnInit { console.log(this.businessListLength) this.businessList.sort((a: any, b: any) => { return b.id - a.id; + }); + this.businessList.forEach((element, index) => { + element.index = index + + }); this.businessListSource['data'] = this.businessList; console.log(this.businessListSource) diff --git a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts index a72c3ab..45db101 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts +++ b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts @@ -229,7 +229,7 @@ unavailability(action,obj) { "qualification":null, "days": null, "languages": null, - "workingHours": JSON.stringify([{"sunday":{"hours":[{"startTime":"09:30 am","endTime":"06:00 pm","day":"sunday","value":null}],"breaks":[]}},{"monday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"monday","value":null}],"breaks":[]}},{"tuesday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"tuesday","value":null}],"breaks":[]}},{"wednesday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"wednesday","value":null}],"breaks":[]}},{"thursday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"thursday","value":null}],"breaks":[]}},{"friday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"friday","value":null}],"breaks":[]}},{"saturday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"saturday","value":null}],"breaks":[]}}]), + "workingHours": JSON.stringify( [{"sunday":{"hours":[],"breaks":[]}},{"monday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"monday","value":null}],"breaks":[]}},{"tuesday":{"hours":[],"breaks":[]}},{"wednesday":{"hours":[],"breaks":[]}},{"thursday":{"hours":[],"breaks":[]}},{"friday":{"hours":[],"breaks":[]}},{"saturday":{"hours":[],"breaks":[]}}]), "dob": null, "designtion": null, "gender": null, @@ -239,6 +239,24 @@ unavailability(action,obj) { "isActive": "1", }] + let param; + let tmp = [{"sunday":{"hours":[],"breaks":[]}},{"monday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"monday","value":null}],"breaks":[]}},{"tuesday":{"hours":[],"breaks":[]}},{"wednesday":{"hours":[],"breaks":[]}},{"thursday":{"hours":[],"breaks":[]}},{"friday":{"hours":[],"breaks":[]}},{"saturday":{"hours":[],"breaks":[]}}] + + param ={practitionerId: this.usersList.id,workingHours:JSON.stringify(tmp)} + + + + + this._api.createPractitionerInfo(param).subscribe(res => { + if (res.status == 200) { + console.log(res) + + } + else{ + + } + } ); + } this.practitionerdetails = this.usersList['practitionerInfos'][0] // this.practitionerdetails.skills = JSON.parse(this.practitionerdetails.skills) @@ -424,6 +442,8 @@ unavailability(action,obj) { }else{ userid = localStorage.getItem('user_id') } + // let userid = localStorage.getItem('user_id') + let tmp = [{"sunday":{"hours":[],"breaks":[]}},{"monday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"monday","value":null}],"breaks":[]}},{"tuesday":{"hours":[],"breaks":[]}},{"wednesday":{"hours":[],"breaks":[]}},{"thursday":{"hours":[],"breaks":[]}},{"friday":{"hours":[],"breaks":[]}},{"saturday":{"hours":[],"breaks":[]}}] let param: any = { "exp": this.exp, // "id": this.id, "qualification": this.qualification, @@ -432,7 +452,7 @@ unavailability(action,obj) { "dob": this.dob, "designtion": this.qualification, "gender": this.gender, - "workingHours": JSON.stringify([{"sunday":{"hours":[{"startTime":"09:30 am","endTime":"06:00 pm","day":"sunday","value":null}],"breaks":[]}},{"monday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"monday","value":null}],"breaks":[]}},{"tuesday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"tuesday","value":null}],"breaks":[]}},{"wednesday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"wednesday","value":null}],"breaks":[]}},{"thursday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"thursday","value":null}],"breaks":[]}},{"friday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"friday","value":null}],"breaks":[]}},{"saturday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"saturday","value":null}],"breaks":[]}}]), + "workingHours": JSON.stringify( tmp), "description": this.description, // "skills": JSON.stringify(this.skills), "caption": this.caption, diff --git a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts index 8c1488e..56d323c 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts +++ b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts @@ -171,14 +171,14 @@ export class EditWorkingHoursComponent implements OnInit { let sunday ={filters :this.data[0].sunday.hours } - for(let i=0;i<=this.data[0].sunday.hours.length-2;i++){ + for(let i=0;i<=this.data[0].sunday.hours.length-1;i++){ this.addFilterToFiltersFormArray() this.dynamicForm.patchValue(sunday) } // if(this.data[0].sunday.hours.length>1){ // } - + this.dynamicForm.patchValue(sunday) // this.data[1].monday.hours.forEach(element => { // element.value = null @@ -190,6 +190,7 @@ export class EditWorkingHoursComponent implements OnInit { this.addFilterToFiltersFormArray2() this.dynamicForm2.patchValue(monday) } + this.dynamicForm2.patchValue(monday) // if(this.data[1].monday.hours.length>1){ // this.addFilterToFiltersFormArray2() // } @@ -204,7 +205,7 @@ export class EditWorkingHoursComponent implements OnInit { this.addFilterToFiltersFormArray3() this.dynamicForm3.patchValue(tuesday) } - + this.dynamicForm3.patchValue(tuesday) let wednesday ={filters4 :this.data[3].wednesday.hours } // if(this.data[3].wednesday.hours.length>1){ @@ -216,7 +217,7 @@ export class EditWorkingHoursComponent implements OnInit { this.dynamicForm4.patchValue(wednesday) } - + this.dynamicForm4.patchValue(wednesday) let thursday ={filters5 :this.data[4].thursday.hours } // if(this.data[4].thursday.hours.length>1){ // this.addFilterToFiltersFormArray5() @@ -227,7 +228,7 @@ export class EditWorkingHoursComponent implements OnInit { this.dynamicForm5.patchValue(thursday) } - + this.dynamicForm5.patchValue(thursday) // this.dynamicForm5.patchValue(thursday) let friday ={filters6 :this.data[5].friday.hours } // if(this.data[5].friday.hours.length>1){ @@ -241,7 +242,7 @@ export class EditWorkingHoursComponent implements OnInit { this.dynamicForm6.patchValue(friday) } - + this.dynamicForm6.patchValue(friday) let saturday ={filters7 :this.data[6].saturday.hours } // if(this.data[6].saturday.hours.length>1){ // this.addFilterToFiltersFormArray7() @@ -253,7 +254,7 @@ export class EditWorkingHoursComponent implements OnInit { this.dynamicForm7.patchValue(saturday) } - + this.dynamicForm7.patchValue(saturday) // this.dynamicForm7.patchValue(saturday) // }, 2000); diff --git a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.html b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.html index 34e9944..7547649 100644 --- a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.html +++ b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.html @@ -19,41 +19,77 @@ + + + + + + -
S.No {{row.id}}
- - + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name {{row.cusName}} Email {{row.email}} Mobile no {{row.phoneNo}} Address {{row.address_1}}, {{row.city}}, {{row.state}} Action
+ + + + + Name {{row.cusName}} - + Email {{row.email}} - Mobile No {{row.phoneNo}} - + Address {{row.address_1}}
{{row.city}}
{{row.state}}
- + Action @@ -66,7 +102,11 @@ - + --> + + + + { return b.id - a.id; + }); + this.customersList.forEach((element, index) => { + element.index = index + + }); this.customersListSource['data'] = this.customersList; } else{ @@ -137,6 +142,11 @@ export class CustomersListComponent implements OnInit { console.log(this.customersListLength) this.customersList.sort((a: any, b: any) => { return b.id - a.id; + }); + this.customersList.forEach((element, index) => { + element.index = index + + }); this.customersListSource['data'] = this.customersList; console.log(this.customersListSource) diff --git a/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.html b/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.html index 2bbbdf3..f789440 100644 --- a/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.html +++ b/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.html @@ -24,37 +24,73 @@ --> - +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
S.No {{row.serviceId}} Service Name {{row.servicesName}} Duration {{row.duration}} Mins Fees {{row.fees}} Description {{row.description}} Action
+ + + S.No {{row.serviceId}} - - + Service Name {{row.servicesName}} - Duration {{row.duration}} Mins + Fees {{row.fees}} - + Description {{row.description}} - +
- - Action @@ -67,7 +103,8 @@ - + --> + S.No - {{element.id}} + {{element.index+1}} Logo @@ -55,7 +55,7 @@ - Business Name + Business Name {{element.BusinessDetails.length>0 ? element.BusinessDetails[0].busName : null }} diff --git a/ng-seed/src/app/appoinment/user/user-list/user-list.component.scss b/ng-seed/src/app/appoinment/user/user-list/user-list.component.scss index 290bcec..a0a34d6 100644 --- a/ng-seed/src/app/appoinment/user/user-list/user-list.component.scss +++ b/ng-seed/src/app/appoinment/user/user-list/user-list.component.scss @@ -204,4 +204,7 @@ img { overflow: auto; max-height: 500px; } + .th-mat{ + width: 18%; + } \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts b/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts index 1307613..4dbbe26 100644 --- a/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts +++ b/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts @@ -86,11 +86,17 @@ export class UserListComponent implements OnInit { this._use.getUsersListDetails(param).subscribe(res => { if (res.status == 200) { this.isLoading = false - let usersList = res.data + let usersList:any = res.data usersList.sort((a: any, b: any) => { return b.id - a.id; + }); + usersList.forEach((element, index) => { + element.index = index + + }); this.usersList['data'] = usersList; + this.usersListLength = res.data.length; this.recordStatus=false; } diff --git a/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.html b/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.html index 8375d8e..5ad5738 100644 --- a/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.html +++ b/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.html @@ -161,4 +161,4 @@
--> -

Please Wait......

+ diff --git a/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts b/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts index d0a0192..5dff102 100644 --- a/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts +++ b/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts @@ -18,7 +18,7 @@ export class DoctorProfileComponent implements OnInit { skillsDetails: any = []; constructor(private router:Router,public end_user:EndUserService,private spinner:NgxSpinnerService) { - this.spinner.show() + // this.spinner.show() } ngOnInit(): void { @@ -47,10 +47,10 @@ export class DoctorProfileComponent implements OnInit { console.log(URL_AS_LIST); // this.router.navigate(['customer/business/'+URL_AS_LIST[3]]) } - setTimeout(() => { - /** spinner ends after 5 seconds */ - this.spinner.hide(); - }, 1000); + // setTimeout(() => { + // /** spinner ends after 5 seconds */ + // this.spinner.hide(); + // }, 1000); }) } diff --git a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.ts b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.ts index 8ed957f..46cbe16 100644 --- a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.ts +++ b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.ts @@ -4,6 +4,7 @@ import { FormControl, FormGroup, Validators } from '@angular/forms'; import { Router } from '@angular/router'; import * as moment from 'moment'; import { EndUserService } from '../end-user.service'; + @Component({ selector: 'app-slot-booking-details', @@ -47,6 +48,7 @@ export class SlotBookingDetailsComponent implements OnInit { bookedAppointment:any=[]; bookedAppointmentSlot: any=[]; days: any=[]; + dayName:any=[]; busName: any =[]; doctor: any=[]; servicesName: any=[]; @@ -295,9 +297,24 @@ export class SlotBookingDetailsComponent implements OnInit { if( this.clicks <5){ this.clicks += 1; } - + console.log(this.days,this.days[ this.clicks], this.clicks) - + let options:any = { weekday: 'long'}; + var prnDt = new Date(this.days[ this.clicks]).toLocaleTimeString('en-us', options); + var formatDate = prnDt.split(" ") + console.log(formatDate) + + this.dayName = formatDate[0] + + let params ={"id":this.user.id , "day": this.dayName , "addcount": this.clicks} + + this.end_user.getSlots(params).subscribe(res => { + if (res.status == 200) { + console.log(res) + let data = res['data']; + this.slots = data + } + }) } goToSlotBooking2(){ @@ -306,7 +323,25 @@ export class SlotBookingDetailsComponent implements OnInit { this.clicks -= 1; } console.log( this.clicks) - + + console.log(this.days,this.days[ this.clicks], this.clicks) + + let options:any = { weekday: 'long'}; + var prnDt = new Date(this.days[ this.clicks]).toLocaleTimeString('en-us', options); + var formatDate = prnDt.split(" ") + console.log(formatDate) + + this.dayName = formatDate[0] + + let params ={"id":this.user.id , "day": this.dayName , "addcount": this.clicks} + + this.end_user.getSlots(params).subscribe(res => { + if (res.status == 200) { + console.log(res) + let data = res['data']; + this.slots = data + } + })