/// <summary> /// /// </summary> /// <param name="list"></param> /// <param name="begin"></param> private static void SaleChartDateWeek(List <SaleChartDate> list, DateTime begin) { var index = list.Count; var m = new SaleChartDate() { Index = index, Begin = begin, End = begin.AddDays(7).AddSeconds(-1), }; m.EndNextDay = m.End.Date.AddDays(1); m.Name = $"{begin:MM/dd}-{m.End:MM/dd}"; list.Add(m); }
/// <summary> /// /// </summary> /// <param name="list"></param> /// <param name="begin"></param> private static void SaleChartDateMonth(List <SaleChartDate> list, DateTime begin) { var index = list.Count; var m = new SaleChartDate() { Index = index, Begin = begin, End = begin.AddMonths(1).AddSeconds(-1), Name = $"{begin:yyyy年MM月}", }; m.EndNextDay = m.End.Date.AddDays(1); list.Add(m); }
/// <summary> /// /// </summary> /// <param name="list"></param> /// <param name="begin"></param> /// <param name="end"></param> /// <param name="name"></param> private static void SaleChartDate(List <SaleChartDate> list, DateTime begin, string name) { var index = list.Count; var m = new SaleChartDate() { Index = index, Begin = begin, End = begin.AddDays(1).AddSeconds(-1), Name = $"{begin:MM/dd}({name})", }; m.EndNextDay = m.End.Date.AddDays(1); list.Add(m); }