public static async Task <List <Plan> > MonthsPlan(string userEmailId) { Crew crew = await CabinCrewPlansHelper.ReadJson(userEmailId); DateTime today = DateTime.Today; DateTime monthafter = today.AddDays(30); List <Plan> weekplan = crew.plan.Where(c => c.date >= today && c.date <= monthafter).ToList(); return(weekplan); }
public static async Task <List <Plan> > MonthsPlan(string userEmailId, IConfiguration configuration) { Crew crew = await CabinCrewPlansHelper.ReadJson(userEmailId, configuration); if (crew != null) { DateTime today = DateTime.Today; DateTime monthafter = today.AddDays(30); List <Plan> weekplan = crew.plan.Where(c => c.flightDetails.flightStartDate >= today && c.flightDetails.flightStartDate <= monthafter).ToList(); return(weekplan); } else { return(new List <Plan>()); } }