Просмотр исходного кода

add locale when formating date to month

add_swagger
MSI\2Fi 8 месяцев назад
Родитель
Сommit
4c82fd0354
1 измененных файлов: 5 добавлений и 1 удалений
  1. +5
    -1
      src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt

+ 5
- 1
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
}


Загрузка…
Отмена
Сохранить