appointment-picker icon indicating copy to clipboard operation
appointment-picker copied to clipboard

Increase max interval for longer appointments

Open jannicz opened this issue 5 years ago • 14 comments

A viable scenario is that an appointment could last 2h, why the limit for 60min?

jannicz avatar May 25 '19 08:05 jannicz

Hi Jannicz,

Can you please advise how to set startTime for example 08.30 etc... I mean with leading minutes. If you could provide a feedback asap as it is urgent. Thanks in advance.

Regards, Shehroze

Shehroze-Nvision avatar Oct 27 '20 07:10 Shehroze-Nvision

@Shehroze-Nvision I guess your question has nothing to do with the issue in the title, right? What you asking is to be able to set a startTime that is not an integer? Currently all default values can only be integer <24 (what means that they have to be full hours). So the lib does not support it.

You could do a workaround by setting startTime to 8 and adding the option disabled: ['8:00', '8:15'] so that times below 8:30 cannot be picket. You could then set the initial value of the text input field to <input type="text" value="8:30">. Doing that, the field would have the starting value of 8:30 and the values below would be greyed out.

jannicz avatar Oct 27 '20 08:10 jannicz

@jannicz Yes it has nothing to do with this issue. sorry i dont know how to get contact with you thats why i commented here.. Thanks alot for the reply.. i will try the workaround.

Shehroze-Nvision avatar Oct 27 '20 08:10 Shehroze-Nvision

Hi @jannicz ,

I have tried the workaround but the values are not being displayed as greyed out but it is not selectable when clicked, the issue is that it is not displayed as greyed out.

I think it is a bug the top row is not shown as disabled when the values treated as disabled but when the values come to the second row it can be displayed as greyed out. Please view below screenshots and advise if can get a fix for this.

bug

bug1

Shehroze-Nvision avatar Oct 28 '20 05:10 Shehroze-Nvision

Thats interesting, indeed. But I see another difference between the configurations in the screenshots. In screenshot 1 the leadingZero is true, in screenshot 2 it is false, am I right?

Assumption: if you set the disabled array for the configuration in 1 as disabled: ['08:00', '08:15'] it might work. Try.

jannicz avatar Oct 28 '20 07:10 jannicz

Yes, you are right.

Even without leadingZero it is still the same issue, i think it is for sure a bug, a fix for this would be highly appreciated.

Shehroze-Nvision avatar Oct 28 '20 07:10 Shehroze-Nvision

Please send me the picker configuration in screenshot 1 and I will have a look ;-)

jannicz avatar Oct 28 '20 07:10 jannicz

timePicker(): void{ this.picker = new AppointmentPicker(this.input.nativeElement, { interval: this.intervalTime, startTime: '08', endTime: '17', disabled: ["08:00", "08:15", "08:30", "12:45", "13:00"], large: true, templateInner: '<li class="appo-picker-list-item" {{disabled}}><input type="button" tabindex="-1" value="{{time}}" {{disabled}}>', templateOuter: 'Pick Available Time

    {{innerHtml}}
' }); }

When i inspected the picker, i can see the disabled attribute is not being assigned to the first row of the array. please have a look at the below screenshot:

image

Shehroze-Nvision avatar Oct 28 '20 08:10 Shehroze-Nvision

@jannicz , Please can you provide a feedback on the above. Thanks

Shehroze-Nvision avatar Oct 29 '20 06:10 Shehroze-Nvision

Yes, so your configuration has an error. startTime and endTime must be of type integer(instead of e a string). Then it should work.

jannicz avatar Oct 29 '20 08:10 jannicz

@jannicz ,

Yes i had to pass it as string because was getting the following errors. Maybe you could advise on this error below when passing integer : You may need an additional loader to handle the result of these loaders. | this.picker = new AppointmentPicker(this.input.nativeElement, { | interval: this.intervalTime,

        startTime: 08,

| endTime: '17', | disabled: this.disabledTime,

image

Shehroze-Nvision avatar Oct 29 '20 08:10 Shehroze-Nvision

Try passing 8 instead of 08.

jannicz avatar Oct 29 '20 09:10 jannicz

@jannicz

Yes that did the trick. Thanks alot for the support you provided. You are the best man. Keep it up !! 👍 💯 🥇

Shehroze-Nvision avatar Oct 29 '20 09:10 Shehroze-Nvision

Thank you! Good luck with your project :-)

jannicz avatar Oct 29 '20 09:10 jannicz