So I have a little problem, I don’t know If I’m overthinking this or what …
Setup:
Field One: Date (Date Out) /* when something is about to leave
Field Two: Date (Date In) /* when something is about to comeback
Field Three: DateRange (Value of Out + In) /* This is what I use when to display something in my calendar.
Field Four: Date (List) - The dates in between DateOut and DateIn
So when I do a “Search” my goal is to have the dateList “does not contain current cell’s date”
But at the moment, anything in between start and end also appears, see below:
E.g:
DateRangeStart = 1 of July
DateRangeCenter = 3 of July
DateRangeEnd = 5 of of July
I wanna save those values to the dateList, but the values missing here is the 2th of July and the 4th of July, anyone have any idea what to do? or I’m I overthinking this?
Hi, tried it. Didn’t get the result I wanted, sadly.
Tou, I think I’m on the right track at the moment.
var getDates = function(startDate, endDate) {
var dates = [],
currentDate = startDate,
addDays = function(days) {
var date = new Date(this.valueOf());
date.setDate(date.getDate() + days);
return date;
};
while (currentDate <= endDate) {
dates.push(currentDate);
currentDate = addDays.call(currentDate, 1);
}
return dates;
};
// Usage
var dates = getDates(new Date(date and time#1formatted as 2019,07,19), new Date(date and time#2formatted as 2019,07,23));
dates.forEach(function(date) {
console.log(date);
});
getDates(to-custom-state-list) - Custom state is defined as a date and made it a list.
I can see the dates in the console, but won’t get inside the custom-state sadly.
Hmm aren’t you basically just looking to select multiple dates while excluding certain dates?
I assumed you could simply use the picker in ‘multiple formats mode’, and provide all the dates you want and exclude in their respective list of dates fields.