Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
lutece
lutece-form-plugin-forms
Commits
ea223d5a
Commit
ea223d5a
authored
Oct 20, 2021
by
Guillaume Lépine
Browse files
FORMS-509: Fix display of dates when loading a draft
parent
d3cbf240
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/java/fr/paris/lutece/plugins/forms/web/entrytype/EntryTypeDateDisplayService.java
View file @
ea223d5a
...
...
@@ -33,6 +33,8 @@
*/
package
fr.paris.lutece.plugins.forms.web.entrytype
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Map
;
...
...
@@ -44,9 +46,11 @@ import fr.paris.lutece.plugins.forms.business.form.column.IFormColumn;
import
fr.paris.lutece.plugins.forms.business.form.column.impl.FormColumnEntry
;
import
fr.paris.lutece.plugins.forms.util.FormsConstants
;
import
fr.paris.lutece.plugins.genericattributes.business.Entry
;
import
fr.paris.lutece.plugins.genericattributes.business.Response
;
import
fr.paris.lutece.plugins.genericattributes.service.entrytype.EntryTypeServiceManager
;
import
fr.paris.lutece.plugins.genericattributes.service.entrytype.IEntryTypeService
;
import
fr.paris.lutece.portal.service.template.AppTemplateService
;
import
fr.paris.lutece.util.date.DateUtil
;
/**
* The display service for entry type date
...
...
@@ -98,7 +102,16 @@ public class EntryTypeDateDisplayService implements IEntryDisplayService
{
String
strEntryHtml
=
StringUtils
.
EMPTY
;
IEntryTypeService
service
=
EntryTypeServiceManager
.
getEntryTypeService
(
entry
);
List
<
Response
>
listResponse
=
retrieveResponseListFromModel
(
model
);
for
(
Response
response
:
listResponse
)
{
String
strValueEntry
=
response
.
getResponseValue
(
);
if
(
StringUtils
.
isNotEmpty
(
strValueEntry
)
)
{
Date
tDateValue
=
new
Date
(
Long
.
parseLong
(
strValueEntry
)
);
response
.
setToStringValueResponse
(
DateUtil
.
getDateString
(
tDateValue
,
locale
)
);
}
}
switch
(
displayType
.
getMode
(
)
)
{
case
EDITION:
...
...
webapp/WEB-INF/templates/admin/plugins/forms/entries/readonly_entry_type_date.html
View file @
ea223d5a
...
...
@@ -3,11 +3,7 @@
<
@
columns
sm=
9
>
<
#if
list_responses
?
has_content
>
<
#list
list_responses
as
response
>
<
@
p
>
<
#if
response.toStringValueResponse
??
>
${response.toStringValueResponse?number?number_to_date?string("dd/MM/yyyy")!''}
</
#
if>
</
@
p>
<
@
p
>
${response.toStringValueResponse!''}
</
@
p>
</
#
list>
</
#
if>
</
@
columns>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment