Index: src/main/groovy/com/lemans/correspondence/domain/forms/DomainForm.groovy =================================================================== diff -u -r3ecf807f4027e53b3aaac2ffc17fc3617bfcc641 -r0e84ff6bac74136ed296f9519025d65e4519e108 --- src/main/groovy/com/lemans/correspondence/domain/forms/DomainForm.groovy (.../DomainForm.groovy) (revision 3ecf807f4027e53b3aaac2ffc17fc3617bfcc641) +++ src/main/groovy/com/lemans/correspondence/domain/forms/DomainForm.groovy (.../DomainForm.groovy) (revision 0e84ff6bac74136ed296f9519025d65e4519e108) @@ -16,6 +16,7 @@ import javax.persistence.Table import javax.persistence.Transient import javax.validation.constraints.Size +import java.time.LocalDate @Entity(name = 'DomainForm') @ToString @@ -39,9 +40,9 @@ @Size(max = 50, message = 'formName ${validatedValue} exceeds the maximum size of {max}') String formName - Date startDate + LocalDate startDate - Date endDate + LocalDate endDate @Lob String formDetailXml Index: src/main/groovy/com/lemans/correspondence/services/DomainFormManagerService.groovy =================================================================== diff -u -r3ecf807f4027e53b3aaac2ffc17fc3617bfcc641 -r0e84ff6bac74136ed296f9519025d65e4519e108 --- src/main/groovy/com/lemans/correspondence/services/DomainFormManagerService.groovy (.../DomainFormManagerService.groovy) (revision 3ecf807f4027e53b3aaac2ffc17fc3617bfcc641) +++ src/main/groovy/com/lemans/correspondence/services/DomainFormManagerService.groovy (.../DomainFormManagerService.groovy) (revision 0e84ff6bac74136ed296f9519025d65e4519e108) @@ -10,6 +10,8 @@ import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional +import java.time.LocalDate + @Service @Transactional class DomainFormManagerService extends LemansManager { @@ -54,6 +56,7 @@ DomainForm updateDomainForm(Map values, String formKey, String username, Integer domainId) { DomainForm domainForm = findDomainForm(formKey, domainId) if (domainForm) { + formatDateFields(values) applyValuesToDomain(values, domainForm) Map form = values.form if (form) { @@ -65,7 +68,13 @@ } domainForm } - + + + void formatDateFields(Map values) { + values.startDate = values.startDate ? LocalDate.parse(values.startDate) : null + values.endDate = values.endDate ? LocalDate.parse(values.endDate) : null + } + /** * Soft deletes a DomainForm. *