Hi Guys I have a requirement that i need block calendar dates based on condition as I'm using input date picker
were the requirement is that we need book a slot for photographer for photoshoot so based on business hours
we have defined business hours i.e. weekstart,weekend & business holiday
on weekstart dates should be enable until weekend den remaining dates should be disabled
on business holidays date should be disabled in calendar
so I'm quite stuck with this implementation
please help me with this guys
thanks advance
Please check following discussion. It might help you
https://www.outsystems.com/forums/discussion/87400/outsystems-ui-disable-dates-on-date-picker-in-outsystems-ui-version-2-9-0/
Also check the oml file you can use DisabledDates (List of dates for the disabled days.) to disable specific dates. You need to calculate the date before loading the date picker and pass that list to the component.
@Navneet Garg Thanks for your help I'm looking out for above requirement
This is another discussion it will help you to build the disable date list
https://www.outsystems.com/forums/discussion/92177/date-picker-disable-date-pick-by-user-and-holidays/
Thanks for input as in this discussion dey have used dates to block as we are looking date & day because we have define business hours using days not date please suggest me on this
Hi @Anush Kumar
Since you need business hours defined by days (Mon–Sun) and not by specific dates, while holidays are date-based; you can go with below approach:
1. Use BusinessHours entity (this would be day based) with Attributes:
DayOfWeek (Integer 1–7), IsWorking (Boolean), StartTime (Time), EndTime (Time)
2. Use Holidays entity (this would be Date-based)
HolidayDate (Date)
3. Now, when user opens calendar, for each visible date:
4. Use a client action to compute disabled dates. DisabledDates would be Empty List initially and post calculation bind DisabledDates to your Date Picker.
Hope this helps.
Its nice approach. I notice the question was asked on Apr 9, Idk whether @Anush Kumar is still keen on this or not
Use logic instead of hard-coding the Date Picker.
Disable weekends by checking the weekday (allow only Monday to Friday).
Store business holidays in a BusinessHoliday entity.
Before loading the Date Picker, fetch holidays and pass them as DisabledDates to the Date Picker component.
This way, weekends and holidays are disabled dynamically and only valid business dates remain selectable.