From 97ccec0c8dedc22f1f05ab4459cd0406cd3bd60f Mon Sep 17 00:00:00 2001 From: sal153 Date: Thu, 29 Aug 2024 11:55:42 +1000 Subject: [PATCH 1/2] commit updates #3311 --- .../au/org/ala/merit/ActivityController.groovy | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/grails-app/controllers/au/org/ala/merit/ActivityController.groovy b/grails-app/controllers/au/org/ala/merit/ActivityController.groovy index 401ad8bc2..e74b3b01b 100644 --- a/grails-app/controllers/au/org/ala/merit/ActivityController.groovy +++ b/grails-app/controllers/au/org/ala/merit/ActivityController.groovy @@ -8,6 +8,9 @@ import org.apache.poi.ss.usermodel.Workbook import org.apache.poi.ss.usermodel.WorkbookFactory import org.apache.poi.ss.util.CellReference +import java.sql.Date +import java.time.LocalDate + class ActivityController { def activityService, siteService, projectService, metadataService, userService, excelImportService, webService, speciesService, documentService, reportService, programService, projectConfigurationService @@ -526,6 +529,15 @@ class ActivityController { Workbook workbook = WorkbookFactory.create(file.inputStream) def data = excelImportService.convertColumnMapConfigManyRows(workbook, config) + data.each { row -> + for (entry in row) { + if (entry.value instanceof org.joda.time.LocalDate) { + //update the type for the datepicker + entry.value = entry.value.toDate() + + } + } + } // Do species lookup def species = model.find {it.dataType == 'species'} From ff94d301344e733c991761df43b57f9a1da48054 Mon Sep 17 00:00:00 2001 From: sal153 Date: Fri, 6 Sep 2024 15:35:41 +1000 Subject: [PATCH 2/2] removed unused imports #3311 --- .../controllers/au/org/ala/merit/ActivityController.groovy | 3 --- 1 file changed, 3 deletions(-) diff --git a/grails-app/controllers/au/org/ala/merit/ActivityController.groovy b/grails-app/controllers/au/org/ala/merit/ActivityController.groovy index e74b3b01b..f78f9e0ca 100644 --- a/grails-app/controllers/au/org/ala/merit/ActivityController.groovy +++ b/grails-app/controllers/au/org/ala/merit/ActivityController.groovy @@ -8,9 +8,6 @@ import org.apache.poi.ss.usermodel.Workbook import org.apache.poi.ss.usermodel.WorkbookFactory import org.apache.poi.ss.util.CellReference -import java.sql.Date -import java.time.LocalDate - class ActivityController { def activityService, siteService, projectService, metadataService, userService, excelImportService, webService, speciesService, documentService, reportService, programService, projectConfigurationService