Commit ca2334dc authored by Guillaume Lépine's avatar Guillaume Lépine
Browse files

FORMS-725 / FORMS-708 : Update date management for new macro in lutece 7.0.1

parent 70b3e462
......@@ -33,8 +33,6 @@
*/
package fr.paris.lutece.plugins.forms.web.form.column.display.impl;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedHashMap;
......@@ -54,7 +52,7 @@ import fr.paris.lutece.plugins.genericattributes.business.Entry;
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.portal.service.util.AppPropertiesService;
import fr.paris.lutece.util.date.DateUtil;
/**
* Implementation of the IFormColumnDisplay for the Entry column
......@@ -72,9 +70,6 @@ public class FormColumnDisplayEntry extends AbstractFormColumnDisplay
private static final String MARK_COLUMN_SORT_ATTRIBUTE = "column_sort_attribute";
private static final String MARK_SORT_URL = "sort_url";
private static final String FILTER_DATE_FORMAT = AppPropertiesService.getProperty( "forms.index.date.format", "dd/MM/yyyy" );
private final DateFormat _dateFormat = new SimpleDateFormat( FILTER_DATE_FORMAT );
/**
* {@inheritDoc}
*/
......@@ -138,7 +133,7 @@ public class FormColumnDisplayEntry extends AbstractFormColumnDisplay
{
Long convertedLong = Long.parseLong( stringToConvert );
Date date = new Date( convertedLong );
String strDate = _dateFormat.format( date );
String strDate = DateUtil.getDateString( date, locale );
listEntryValues.add( strDate );
}
......
......@@ -10,8 +10,8 @@ title varchar(255) default '' NOT NULL,
description varchar(255) default '',
creation_date timestamp default CURRENT_TIMESTAMP NOT NULL,
update_date timestamp default '1980-01-01 00:00' NOT NULL,
availability_start_date timestamp default '1980-01-01 00:00' NOT NULL,
availability_end_date timestamp default '1980-01-01 00:00' NOT NULL,
availability_start_date timestamp NULL,
availability_end_date timestamp NULL,
max_number_response INT default 0,
workgroup varchar(255),
id_workflow INT DEFAULT NULL,
......
ALTER TABLE forms_form MODIFY availability_start_date TIMESTAMP NULL;
ALTER TABLE forms_form MODIFY availability_end_date TIMESTAMP NULL;
......@@ -21,7 +21,6 @@ forms.internalIndexer.lucene.indexPath=/index
forms.globalIndexer.enable=true
forms.internalIndexer.lucene.indexInWebapp=true
forms.index.writer.commit.size=1000
forms.index.date.format=dd/MM/yyyy
forms.export.csv.zip=true
forms.export.pdf.zip=false
......
......@@ -16,7 +16,13 @@
<@formGroup labelFor='${idName}' labelKey='${entry.title}' helpKey=helpKey groupStyle=groupStyle mandatory=entry.mandatory>
<@inputGroup>
<#assign field = getFieldByCode( entry, "default_date_value" )>
<@input type='date' language=locale.language name='${idName}' id='${idName}' class='${entry.CSSClass!}' value=(response.toStringValueResponse)!(field.valueTypeDate)! />
<#assign default=''>
<#if response?? && response.responseValue??>
<#assign default=response.responseValue>
<#elseif field.valueTypeDate?? >
<#assign default=field.valueTypeDate?iso_local>
</#if>
<@input type='date' language=locale.language name='${idName}' id='${idName}' class='${entry.CSSClass!}' value=(response.toStringValueResponse)!(default)! />
<@inputGroupItem type='text'>
<@icon style='calendar' />
</@inputGroupItem>
......
......@@ -32,7 +32,11 @@ ${breadcrumb_template}
<#assign field = getFieldByCode( entry, "default_date_value" ) >
<@inputGroup>
<@inputGroupItem type='text'><@icon style='calendar' /></@inputGroupItem>
<@input type='date' language=locale name='value' id='date' value='${field.valueTypeDate?if_exists}' />
<#assign default=''>
<#if field.valueTypeDate?? >
<#assign default=field.valueTypeDate?iso_local>
</#if>
<@input type='date' language=locale name='value' id='date' value=default />
</@inputGroup>
</@formGroup>
<@formGroup>
......
......@@ -3,7 +3,9 @@
<@columns sm=9>
<#if list_responses?has_content>
<#list list_responses as response>
<@p>${response.toStringValueResponse!''}</@p>
<#if response.responseValue??>
<@p>${response.responseValue?number?number_to_date}</@p>
</#if>
</#list>
</#if>
</@columns>
......
<@td><#if form_response_date_creation?has_content>${form_response_date_creation?string["dd/MM/yyyy"]}</#if></@td>
\ No newline at end of file
<@td><#if form_response_date_creation?has_content>${form_response_date_creation?date}</#if></@td>
\ No newline at end of file
<@td><#if form_response_date_update?has_content> ${form_response_date_update?string["dd/MM/yyyy"]}</#if></@td>
\ No newline at end of file
<@td><#if form_response_date_update?has_content> ${form_response_date_update?date}</#if></@td>
\ No newline at end of file
......@@ -37,7 +37,12 @@
</#list>
</#if>
<@getDatePickerBootstrap idField="${idName}" language=locale.language />
<#assign default=''>
<#if field.valueTypeDate?? >
<#assign default=field.valueTypeDate?iso_local>
</#if>
<@getDate idField="${idName}" language=locale.language defaultDate=default/>
<script type="text/javascript" src="js/jquery/plugins/moment.min.js"></script>
<script type="text/javascript">
$( document ).ready(function() {
......
......@@ -12,7 +12,9 @@
<#else>
<div class="col-xs-12 col-sm-9 col-sm-offset-3">
</#if>
${response.toStringValueResponse!''}
<#if response.responseValue??>
${response.responseValue?number?number_to_date}
</#if>
</div>
</#list>
</#if>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment