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
this is not possible through the public api - you will have to override the component.
this is how i pinned the start date. you have to pass proximitySelection=true to the datepicker. you would have to do something similar to pin the end date:
// app/components/power-calendar-range.jsimportCalendarRangeComponentfrom'ember-power-calendar/components/power-calendar-range';import{normalizeRangeActionValue,diff,isBefore,}from'ember-power-calendar-utils';exportdefaultclassextendsCalendarRangeComponent{/** * We have to override this private method in order to pin the * start date in proximity mode by allowing the component to accept an additional * parameter, `startDateLocked`. */_buildRangeByProximity(day,start,end){if(start&&end){letchangeStart;if(this.startDateLocked){changeStart=false;}else{changeStart=Math.abs(diff(day.date,end))>Math.abs(diff(day.date,start));}returnnormalizeRangeActionValue({date: {start: changeStart ? day.date : start,end: changeStart ? end : day.date,},});}if(isBefore(day.date,start)){returnnormalizeRangeActionValue({date: {start: day.date,end: null}});}returnthis._buildDefaultRange(day,start,end);}}
No description provided.
The text was updated successfully, but these errors were encountered: