<#-- WARNING : be careful to white-space and lines break in FreeMarker macros. # This macro template can be used to output white-space-sensitive formats (like RSS files). # See http://dev.lutece.paris.fr/jira/browse/LUTECE-765 --> <#assign styleUrl='css/bootstrap-flatpickr.min.css' /> <#macro getDate idField language=.lang format='' showFormat='' minDate='' maxDate='' defaultDate='' dateOptions={} > <#local dtOptions=dateOptions /> <@initScriptFlatPicker language=language /> <#macro getDateTime idField language=.lang format='' showFormat='' minDate='' maxDate='' defaultDate='' minTime='' maxTime='' defaultTime='' dateOptions={} > <@initScriptFlatPicker language=language /> <#macro getDateRange idField idEndField language=.lang format='' showFormat='' minDate='' maxDate='' defaultDate='' dateOptions={} > <@initScriptFlatPicker language=language range=true/> <#macro getDateTimeRange idField idEndField language=.lang format='' showFormat='' minDate='' maxDate='' defaultDate='' minTime='' maxTime='' defaultTime='' dateOptions={}> <@initScriptFlatPicker language=language range=true /> <#-- getLanguageInLocale # This macro should not be called directly # --> <#macro getLanguageInLocale language><#if language?index_of("_") gt 0>${language?keep_before("_")}<#else>${language} <#-- getDateFormat # This macro should not be called directly # --> <#macro getDateFormat format showFormat time=false> <#if showFormat == ''> const showFormat = getFlatPickerDateFormat( browserCurrentLocale )<#if time> + ' ' + getFlatPickerTimeFormat( browserCurrentLocale ); <#else> const showFormat = '${showFormat}'; <#-- The server parses dates on a per locale basis. The formats here much match those specified by lutece.format.date.short --> <#if format == ''> const dtFormat='Y-m-d H:i:S'; // Default for most DB <#else> const dtFormat='${format}'; <#if time> <#-- initScriptFlatPicker # This macro should not be called directly # --> <#macro initScriptFlatPicker language range=false> <#if datePickerIsLoaded?? && datePickerIsLoaded> <#else> <#if range > <#assign isEn=language?starts_with("en")?c /> <#if !isEn?boolean > <#function setFlatPickerOptions options> <#assign strOptions=''> <#if options?size gt 0><#assign strOptions><#list options as optionKey, optionVal>"${optionKey}" : <#if optionVal?is_boolean>${optionVal?c}<#elseif optionVal?is_number>${optionVal}<#else>"${optionVal}", <#return strOptions>