From 4c82fd0354abea0fc34adf9e02680ecdcfe98d0d Mon Sep 17 00:00:00 2001 From: "MSI\\2Fi" Date: Fri, 13 Dec 2024 17:06:41 +0800 Subject: [PATCH] add locale when formating date to month --- .../com/ffii/tsms/modules/report/service/ReportService.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt b/src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt index e96d7ac..a49278a 100644 --- a/src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt +++ b/src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt @@ -3705,6 +3705,7 @@ open class ReportService( templatePath: String ) : Workbook { +// println(manhourSummary) val resource = ClassPathResource(templatePath) val templateInputStream = resource.inputStream val workbook: Workbook = XSSFWorkbook(templateInputStream) @@ -3719,7 +3720,7 @@ open class ReportService( // .takeWhile { it.isBefore(endMonth) || it.isEqual(endMonth) } .mapIndexed { index, month -> // Format the month as "MMM-yyyy" - val formattedMonth = month.format(DateTimeFormatter.ofPattern("MMM-yyyy")) + val formattedMonth = month.format(DateTimeFormatter.ofPattern("MMM-yyyy", Locale.ENGLISH)) // Calculate the value for this month formattedMonth to (startValue + index) } @@ -3787,6 +3788,9 @@ open class ReportService( tempCell.setCellValue(curr["client"].toString()) for ( month in monthList) { var manhour = 0.0 +// println("curr-rM ${curr["recordMonth"]}") +// println("curr ${curr}") +// println("month $month") if (curr.containsKey(month.key.toString())) { manhour = curr[month.key.toString()] as Double }