Generation

generate functionWed, 16 Nov 2022

create a list of 12 month list and for every day a dictionary

public static List<List<Dictionary<string, object>>> GetMonths() { List<List<Dictionary<string, object>>> months = new List<List<Dictionary<string, object>>>(); for (int week = 1; week <= 12; week++) { List<Dictionary<string, object>> days = new List<Dictionary<string, object>>(); for (int day = 1; day <= 31; day++) { Dictionary<string, object> date = new Dictionary<string, object>(); date.Add("month", week); date.Add("day", day); date.Add("date", week + "/" + day); days.Add(date); } months.Add(days); } return months; }

Questions about programming?Chat with your personal AI assistant