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

This commit is contained in:
張家睿 2024-03-07 14:22:16 +08:00
parent b11299762d
commit 7f7996a681

View File

@ -982,7 +982,7 @@ namespace FrontendWebApi.ApiControllers
colInit = 0; colInit = 0;
cell = row.GetCell(colInit++) ?? row.CreateCell(colInit++); cell = row.GetCell(colInit++) ?? row.CreateCell(colInit++);
DateTime timeDay = DateTime.Parse(input.startTime).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"); string timeRange = start_year + "." + start_month + ".01~" + start_year + "." + timeDay.ToString("MM.dd");
cell.SetCellValue("電錶週期:" + timeRange); cell.SetCellValue("電錶週期:" + timeRange);
//row = sheet.GetRow(rowInit++) ?? sheet.CreateRow(rowInit++); //row = sheet.GetRow(rowInit++) ?? sheet.CreateRow(rowInit++);