[WebApi]修正民國年不會自動判斷為閏年,導致標題在閏年2月份少一天的問題

This commit is contained in:
張家睿 2024-03-07 11:39:17 +08:00
parent 6905d1f342
commit b11299762d

View File

@ -981,7 +981,7 @@ namespace FrontendWebApi.ApiControllers
row = sheet.GetRow(rowInit++) ?? sheet.CreateRow(rowInit++);
colInit = 0;
cell = row.GetCell(colInit++) ?? row.CreateCell(colInit++);
DateTime timeDay = date.AddMonths(1).AddDays(-1); // 用來記錄每個月的最後一天是幾月幾號
DateTime timeDay = DateTime.Parse(input.startTime).AddMonths(1).AddDays(-1); // 用來記錄每個月的最後一天是幾月幾號
string timeRange = start_year + "." + start_month + ".01~" + timeDay.ToString("yyy.MM.dd");
cell.SetCellValue("電錶週期:" + timeRange);