Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions lib/classes/multiple_marked_dates.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,49 @@ class MultipleMarkedDates{
markedDates.add(markedDate);
}

void addRange(MarkedDate markedDate, {int plus = 0, int minus = 0}){
this.add(markedDate);



if (plus > 0){
int start = 1;
MarkedDate newAddMarkedDate;

while (start <= plus){

newAddMarkedDate = new MarkedDate(
color: markedDate.color,
date: markedDate.date.add(Duration(days: start)),
textStyle: markedDate.textStyle,
);

this.add(newAddMarkedDate);

start += 1;
}
}

if (minus > 0){
int start = 1;
MarkedDate newSubMarkedDate;

while (start <= minus){

newSubMarkedDate = new MarkedDate(
color: markedDate.color,
date: markedDate.date.subtract(Duration(days: start)),
textStyle: markedDate.textStyle,
);

this.add(newSubMarkedDate);

start += 1;
}
}
}


void addAll(List<MarkedDate> markedDates){
this.markedDates.addAll(markedDates);
}
Expand Down