You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dynamically disabling dates with data from server as user interacts with calendar: Allow disable {from: -Infinity, to: Infinity} or Prevent cascading changes when set disable when the currently selected item object becomes disabled (for DATES)
#1250
Open
davibertolini opened this issue
Nov 8, 2023
· 0 comments
Dynamically disabling dates with data from server as user interacts with calendar: Allow disable {from: -Infinity, to: Infinity} or Prevent cascading changes when set disable when the currently selected item object becomes disabled (for DATES)
Our use case is the following:
I'm are obtaining data from a server every time the user is moving forward in months (listening to highlight event). In our case I am fetching the next 3 months from "today". When the user advances 2 months, I fetch the next 3 months.
The data obtained from the server is used to determine which dates in the future will be disabled. As soon as data is recovered, I disable the dates, which triggers cascading changes as per docs.
let a_closed_days = // array with dates obtained by the server
myPickadateCal.set('disable', a_closed_days);
There is a case where the data from the server will result in >3+ months dates disabled, since I'm just fetching 3 months, the calendar will change to the next enabled date, with is the first day of the 4th month.
But this is not accurate, since that day is also disabled (but the calendar does not "know" it since I just fetched data for 3 months).
I tried these solutions:
Setting max as the last disabled date: this is not a proper solution because max does not allow the user to continue moving forward in months
Disabling from the last date to Infinity: myPickadateCal.set.set('disable', [{from: dtLastDayClosed, to: Infinity}]); but Infinity is ignored, and does not disable anything.
Disabling from the last date to 10000 days in the future, but the calendar views changes to 10000 days in the future, which will be considered a weird behavior for the user.
But none seem to work. Maybe there will be no response as this project is seems to be deprecated in lieu of V5, but still worth the try. Willing to bounty this to the problem solver.
Thank you.
The text was updated successfully, but these errors were encountered:
Dynamically disabling dates with data from server as user interacts with calendar: Allow disable {from: -Infinity, to: Infinity} or Prevent cascading changes when set disable when the currently selected item object becomes disabled (for DATES)
Our use case is the following:
I'm are obtaining data from a server every time the user is moving forward in months (listening to highlight event). In our case I am fetching the next 3 months from "today". When the user advances 2 months, I fetch the next 3 months.
The data obtained from the server is used to determine which dates in the future will be disabled. As soon as data is recovered, I disable the dates, which triggers cascading changes as per docs.
There is a case where the data from the server will result in >3+ months dates disabled, since I'm just fetching 3 months, the calendar will change to the next enabled date, with is the first day of the 4th month.
But this is not accurate, since that day is also disabled (but the calendar does not "know" it since I just fetched data for 3 months).
I tried these solutions:
myPickadateCal.set.set('disable', [{from: dtLastDayClosed, to: Infinity}]);
but Infinity is ignored, and does not disable anything.But none seem to work. Maybe there will be no response as this project is seems to be deprecated in lieu of V5, but still worth the try. Willing to bounty this to the problem solver.
Thank you.
The text was updated successfully, but these errors were encountered: