jconsumer-shared 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/calendar/time/jaldee-time-service.mjs +203 -0
- package/esm2022/lib/consumer-service.mjs +7 -7
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/jconsumer-shared.mjs +207 -7
- package/fesm2022/jconsumer-shared.mjs.map +1 -1
- package/jconsumer-shared-1.2.3.tgz +0 -0
- package/lib/calendar/time/jaldee-time-service.d.ts +28 -0
- package/lib/consumer-service.d.ts +2 -2
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/jconsumer-shared-1.2.1.tgz +0 -0
|
@@ -1743,8 +1743,12 @@ class ConsumerService {
|
|
|
1743
1743
|
getWaitlist(params) {
|
|
1744
1744
|
return this.servicemeta.httpGet('consumer/waitlist', null, params);
|
|
1745
1745
|
}
|
|
1746
|
-
|
|
1747
|
-
|
|
1746
|
+
getWaitlistToday(filter = {}) {
|
|
1747
|
+
const path = 'consumer/waitlist/today';
|
|
1748
|
+
return this.servicemeta.httpGet(path, null, filter);
|
|
1749
|
+
}
|
|
1750
|
+
getWaitlistFuture(filter = {}) {
|
|
1751
|
+
return this.servicemeta.httpGet('consumer/waitlist/future', null, filter);
|
|
1748
1752
|
}
|
|
1749
1753
|
addConsumerWaitlistAttachment(accountid, uuid, body) {
|
|
1750
1754
|
const url = 'consumer/waitlist/' + uuid + '/attachment' + '?account=' + accountid;
|
|
@@ -1760,10 +1764,6 @@ class ConsumerService {
|
|
|
1760
1764
|
const url = 'consumer/waitlist/attachment/' + uuid + '?account=' + accountid;
|
|
1761
1765
|
return this.servicemeta.httpGet(url);
|
|
1762
1766
|
}
|
|
1763
|
-
getWaitlistToday() {
|
|
1764
|
-
const path = 'consumer/waitlist/today';
|
|
1765
|
-
return this.servicemeta.httpGet(path);
|
|
1766
|
-
}
|
|
1767
1767
|
//Appointment Urls
|
|
1768
1768
|
getAppointmentFuture(params) {
|
|
1769
1769
|
return this.servicemeta.httpGet('consumer/appointment/future', null, params);
|
|
@@ -4824,6 +4824,206 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
4824
4824
|
}]
|
|
4825
4825
|
}], ctorParameters: () => [{ type: ServiceMeta }] });
|
|
4826
4826
|
|
|
4827
|
+
class JaldeeTimeService {
|
|
4828
|
+
dateTimeProcessor;
|
|
4829
|
+
moment;
|
|
4830
|
+
constructor(dateTimeProcessor) {
|
|
4831
|
+
this.dateTimeProcessor = dateTimeProcessor;
|
|
4832
|
+
this.moment = this.dateTimeProcessor.getMoment();
|
|
4833
|
+
}
|
|
4834
|
+
/**
|
|
4835
|
+
*
|
|
4836
|
+
* @param interval
|
|
4837
|
+
* @param startTime
|
|
4838
|
+
* @param endTime
|
|
4839
|
+
* @returns
|
|
4840
|
+
*/
|
|
4841
|
+
getTimeSlotsFromQTimings(interval, startTime, endTime) {
|
|
4842
|
+
const slotList = [];
|
|
4843
|
+
// slotList.push(startTime);
|
|
4844
|
+
const startTimeStr = this.moment(startTime, ['HH:mm A']).format('HH:mm A').toString();
|
|
4845
|
+
let startingDTime = this.dateTimeProcessor.getDateFromTimeString(startTimeStr);
|
|
4846
|
+
slotList.push(this.moment(startTime, ['HH:mm A']).format('hh:mm A').toString());
|
|
4847
|
+
const endTimeStr = this.moment(endTime, ['HH:mm A']).format('HH:mm A').toString();
|
|
4848
|
+
const endDTime = this.dateTimeProcessor.getDateFromTimeString(endTimeStr);
|
|
4849
|
+
// tslint:disable-next-line:radix
|
|
4850
|
+
const endDate = parseInt(this.moment(endDTime, ['DD']).format('DD').toString());
|
|
4851
|
+
// let startingDTime = this.getDateFromTimeString(startTime);
|
|
4852
|
+
let exitLoop = false;
|
|
4853
|
+
while (!exitLoop) {
|
|
4854
|
+
const nextTime = this.moment(startingDTime).add(interval, 'm');
|
|
4855
|
+
// tslint:disable-next-line:radix
|
|
4856
|
+
const nextDate = parseInt(nextTime.format('DD'));
|
|
4857
|
+
const nextTimeDt = this.dateTimeProcessor.getDateFromTimeString(this.moment(nextTime, ['HH:mm A']).format('HH:mm A').toString());
|
|
4858
|
+
if (nextDate === endDate) {
|
|
4859
|
+
if (nextTimeDt.getTime() <= endDTime.getTime()) {
|
|
4860
|
+
slotList.push(this.moment(nextTime, ['HH:mm A']).format('hh:mm A').toString());
|
|
4861
|
+
}
|
|
4862
|
+
else {
|
|
4863
|
+
exitLoop = true;
|
|
4864
|
+
}
|
|
4865
|
+
}
|
|
4866
|
+
else {
|
|
4867
|
+
exitLoop = true;
|
|
4868
|
+
}
|
|
4869
|
+
startingDTime = nextTimeDt;
|
|
4870
|
+
}
|
|
4871
|
+
return slotList;
|
|
4872
|
+
}
|
|
4873
|
+
/**
|
|
4874
|
+
*
|
|
4875
|
+
* @param schedule_arr
|
|
4876
|
+
* @returns
|
|
4877
|
+
*/
|
|
4878
|
+
arrageScheduleforDisplay(schedule_arr) {
|
|
4879
|
+
const timebase = [];
|
|
4880
|
+
for (let i = 0; i < schedule_arr.length; i++) {
|
|
4881
|
+
const timeindx = schedule_arr[i]['sTime'].replace(/\s+/, '') + schedule_arr[i]['eTime'].replace(/\s+/, '');
|
|
4882
|
+
if (timebase[timeindx] === undefined) {
|
|
4883
|
+
timebase[timeindx] = new Array();
|
|
4884
|
+
timebase[timeindx].push(schedule_arr[i]);
|
|
4885
|
+
}
|
|
4886
|
+
else {
|
|
4887
|
+
timebase[timeindx].push(schedule_arr[i]);
|
|
4888
|
+
}
|
|
4889
|
+
}
|
|
4890
|
+
for (const obj in timebase) {
|
|
4891
|
+
if (obj) {
|
|
4892
|
+
const len = timebase[obj].length;
|
|
4893
|
+
for (let i = 0; i < len; i++) {
|
|
4894
|
+
for (let j = i + 1; j < len; j++) {
|
|
4895
|
+
if (timebase[obj][j].day < timebase[obj][i].day) {
|
|
4896
|
+
const tempobj = timebase[obj][i];
|
|
4897
|
+
timebase[obj][i] = timebase[obj][j];
|
|
4898
|
+
timebase[obj][j] = tempobj;
|
|
4899
|
+
}
|
|
4900
|
+
}
|
|
4901
|
+
}
|
|
4902
|
+
}
|
|
4903
|
+
}
|
|
4904
|
+
const displaysch = [];
|
|
4905
|
+
let pday = 0;
|
|
4906
|
+
for (const obj in timebase) {
|
|
4907
|
+
if (obj) {
|
|
4908
|
+
let curstr = '';
|
|
4909
|
+
let gap = 0;
|
|
4910
|
+
for (let i = 0; i < timebase[obj].length; i++) {
|
|
4911
|
+
if (i === 0) {
|
|
4912
|
+
curstr = this.dateTimeProcessor.getDay(timebase[obj][i].day);
|
|
4913
|
+
pday = timebase[obj][i].day;
|
|
4914
|
+
}
|
|
4915
|
+
else {
|
|
4916
|
+
const diffs = timebase[obj][i].day - pday;
|
|
4917
|
+
if (diffs > 1) {
|
|
4918
|
+
if (gap >= 1) {
|
|
4919
|
+
if (curstr.includes((this.dateTimeProcessor.getDay(pday)))) {
|
|
4920
|
+
}
|
|
4921
|
+
else {
|
|
4922
|
+
curstr = curstr + ' - ' + this.dateTimeProcessor.getDay(pday);
|
|
4923
|
+
}
|
|
4924
|
+
}
|
|
4925
|
+
curstr = curstr + ', ' + this.dateTimeProcessor.getDay(timebase[obj][i].day);
|
|
4926
|
+
}
|
|
4927
|
+
else {
|
|
4928
|
+
if (i === (timebase[obj].length - 1)) {
|
|
4929
|
+
curstr = curstr + ' - ' + this.dateTimeProcessor.getDay(timebase[obj][i].day);
|
|
4930
|
+
}
|
|
4931
|
+
gap++;
|
|
4932
|
+
}
|
|
4933
|
+
pday = timebase[obj][i].day;
|
|
4934
|
+
}
|
|
4935
|
+
}
|
|
4936
|
+
displaysch.push({ 'time': timebase[obj][0]['sTime'] + ' - ' + timebase[obj][0]['eTime'], 'dstr': curstr, 'indx': obj, 'recurrtype': timebase[obj][0]['recurrtype'] });
|
|
4937
|
+
}
|
|
4938
|
+
}
|
|
4939
|
+
return displaysch;
|
|
4940
|
+
}
|
|
4941
|
+
getminutesOfDay(m) {
|
|
4942
|
+
return parseInt(m.minute, 10) + parseInt(m.hour, 10) * 60;
|
|
4943
|
+
}
|
|
4944
|
+
getTimeinMin(time) {
|
|
4945
|
+
const time_min = (time.hour * 60) + time.minute;
|
|
4946
|
+
return (typeof (time_min) === 'number') ? time_min : 0;
|
|
4947
|
+
}
|
|
4948
|
+
prepareScheduleforSaving(schedule_arr) {
|
|
4949
|
+
const timebase = [];
|
|
4950
|
+
for (let i = 0; i < schedule_arr.length; i++) {
|
|
4951
|
+
const timeindx = schedule_arr[i]['sTime'].replace(/\s+/, '') + schedule_arr[i]['eTime'].replace(/\s+/, '');
|
|
4952
|
+
if (timebase[timeindx] === undefined) {
|
|
4953
|
+
timebase[timeindx] = new Array();
|
|
4954
|
+
timebase[timeindx].push(schedule_arr[i]);
|
|
4955
|
+
}
|
|
4956
|
+
else {
|
|
4957
|
+
timebase[timeindx].push(schedule_arr[i]);
|
|
4958
|
+
}
|
|
4959
|
+
}
|
|
4960
|
+
for (const obj in timebase) {
|
|
4961
|
+
if (obj) {
|
|
4962
|
+
const len = timebase[obj].length;
|
|
4963
|
+
for (let i = 0; i < len; i++) {
|
|
4964
|
+
for (let j = i + 1; j < len; j++) {
|
|
4965
|
+
if (timebase[obj][j].day < timebase[obj][i].day) {
|
|
4966
|
+
const tempobj = timebase[obj][i];
|
|
4967
|
+
timebase[obj][i] = timebase[obj][j];
|
|
4968
|
+
timebase[obj][j] = tempobj;
|
|
4969
|
+
}
|
|
4970
|
+
}
|
|
4971
|
+
}
|
|
4972
|
+
}
|
|
4973
|
+
}
|
|
4974
|
+
const displaysch = [];
|
|
4975
|
+
for (const obj in timebase) {
|
|
4976
|
+
if (obj) {
|
|
4977
|
+
const curstr = [];
|
|
4978
|
+
for (let i = 0; i < timebase[obj].length; i++) {
|
|
4979
|
+
curstr.push(timebase[obj][i].day);
|
|
4980
|
+
}
|
|
4981
|
+
displaysch.push({ 'stime': timebase[obj][0]['sTime'], 'etime': timebase[obj][0]['eTime'], 'daystr': curstr });
|
|
4982
|
+
}
|
|
4983
|
+
}
|
|
4984
|
+
return displaysch;
|
|
4985
|
+
}
|
|
4986
|
+
formatTime(hours, minutes) {
|
|
4987
|
+
let sHours = hours.toString();
|
|
4988
|
+
let sMinutes = minutes.toString();
|
|
4989
|
+
if (hours < 10) {
|
|
4990
|
+
sHours = '0' + sHours;
|
|
4991
|
+
}
|
|
4992
|
+
if (minutes < 10) {
|
|
4993
|
+
sMinutes = '0' + sMinutes;
|
|
4994
|
+
}
|
|
4995
|
+
const time24 = sHours + ':' + sMinutes + ':00';
|
|
4996
|
+
return time24;
|
|
4997
|
+
}
|
|
4998
|
+
AMHourto24Time(time12) {
|
|
4999
|
+
const time = time12;
|
|
5000
|
+
let hours = Number(time.match(/^(\d+)/)[1]);
|
|
5001
|
+
const minutes = Number(time.match(/:(\d+)/)[1]);
|
|
5002
|
+
const AMPM = time.match(/\s(.*)$/)[1];
|
|
5003
|
+
if (AMPM === 'PM' && hours < 12) {
|
|
5004
|
+
hours = hours + 12;
|
|
5005
|
+
}
|
|
5006
|
+
if (AMPM === 'AM' && hours === 12) {
|
|
5007
|
+
hours = hours - 12;
|
|
5008
|
+
}
|
|
5009
|
+
let sHours = hours.toString();
|
|
5010
|
+
let sMinutes = minutes.toString();
|
|
5011
|
+
if (hours < 10) {
|
|
5012
|
+
sHours = '0' + sHours;
|
|
5013
|
+
}
|
|
5014
|
+
if (minutes < 10) {
|
|
5015
|
+
sMinutes = '0' + sMinutes;
|
|
5016
|
+
}
|
|
5017
|
+
const time24 = sHours + ':' + sMinutes + ':00';
|
|
5018
|
+
return time24;
|
|
5019
|
+
}
|
|
5020
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: JaldeeTimeService, deps: [{ token: DateTimeProcessor }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5021
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: JaldeeTimeService });
|
|
5022
|
+
}
|
|
5023
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: JaldeeTimeService, decorators: [{
|
|
5024
|
+
type: Injectable
|
|
5025
|
+
}], ctorParameters: () => [{ type: DateTimeProcessor }] });
|
|
5026
|
+
|
|
4827
5027
|
class TimezoneConverter {
|
|
4828
5028
|
constructor() {
|
|
4829
5029
|
}
|
|
@@ -7509,5 +7709,5 @@ function setupInjectionContextForLoadChildren(route) {
|
|
|
7509
7709
|
* Generated bundle index. Do not edit.
|
|
7510
7710
|
*/
|
|
7511
7711
|
|
|
7512
|
-
export { AccountService, AuthService, AutolinkPipe, AutolinkPipeModule, BookingService, CapitalizeFirstPipe, CapitalizeFirstPipeModule, CommonService, ConfirmBoxComponent, ConfirmBoxModule, ConsumerService, CurrencyService, DateFormatPipe, DateFormatPipeModule, DateTimeProcessor, EnvironmentService, ErrorMessagingService, ErrrorMessageModule, FieldErrorDisplayComponent, FileService, FilterPipe, FilterPipeModule, FormMessageDisplayModule, FormMessageDisplayService, FormSuccessDisplayComponent, GroupStorageService, HttpLoaderFactory, I8nModule, JGalleryComponent, JGalleryModule, JGalleryService, LoadingSpinnerComponent, LoadingSpinnerModule, LocalStorageService, MediaService, Messages, OrderService, PaymentModesComponent, PaymentModesModule, PaymentsModule, PaytmService, PhoneInputComponent, PhoneInputModule, QuestionaireService, QuestionnaireComponent, QuestionnaireModule, RazorpayService, RequestDialogComponent, RequestDialogModule, SafeHtmlModule, SafeHtmlPipe, ServiceMeta, SessionStorageService, SharedAccountGuard, SharedAccountResolver, SharedService, ShortFileNameModule, ShortFileNamePipe, ShowuploadfileComponent, ShowuploadfileModule, SkeletonLoadingComponent, SkeletonLoadingModule, StorageService, SubscriptionService, ThemeService, TimezoneConverter, ToastService, TruncateModule, TruncatePipe, TwilioService, WordProcessor, loadRemoteModuleWithCache, projectConstantsLocal, setupInjectionContextForLoadChildren };
|
|
7712
|
+
export { AccountService, AuthService, AutolinkPipe, AutolinkPipeModule, BookingService, CapitalizeFirstPipe, CapitalizeFirstPipeModule, CommonService, ConfirmBoxComponent, ConfirmBoxModule, ConsumerService, CurrencyService, DateFormatPipe, DateFormatPipeModule, DateTimeProcessor, EnvironmentService, ErrorMessagingService, ErrrorMessageModule, FieldErrorDisplayComponent, FileService, FilterPipe, FilterPipeModule, FormMessageDisplayModule, FormMessageDisplayService, FormSuccessDisplayComponent, GroupStorageService, HttpLoaderFactory, I8nModule, JGalleryComponent, JGalleryModule, JGalleryService, JaldeeTimeService, LoadingSpinnerComponent, LoadingSpinnerModule, LocalStorageService, MediaService, Messages, OrderService, PaymentModesComponent, PaymentModesModule, PaymentsModule, PaytmService, PhoneInputComponent, PhoneInputModule, QuestionaireService, QuestionnaireComponent, QuestionnaireModule, RazorpayService, RequestDialogComponent, RequestDialogModule, SafeHtmlModule, SafeHtmlPipe, ServiceMeta, SessionStorageService, SharedAccountGuard, SharedAccountResolver, SharedService, ShortFileNameModule, ShortFileNamePipe, ShowuploadfileComponent, ShowuploadfileModule, SkeletonLoadingComponent, SkeletonLoadingModule, StorageService, SubscriptionService, ThemeService, TimezoneConverter, ToastService, TruncateModule, TruncatePipe, TwilioService, WordProcessor, loadRemoteModuleWithCache, projectConstantsLocal, setupInjectionContextForLoadChildren };
|
|
7513
7713
|
//# sourceMappingURL=jconsumer-shared.mjs.map
|