release2.0-SCPN1-11488 into release2.0

This commit is contained in:
2026-11-05 12:54:57 +00:00
parent a58faa3397
commit 8e573a5197
9 changed files with 68 additions and 75 deletions

View File

@@ -44,4 +44,29 @@
</#list>
<#local str += "]">
<#return (str)>
</#function>
<#-- --------------------------------------------------------------------------------------- -->
<#-- validate and convert HARDIS WMS date field into UTC timestamp -->
<#-- Example : RfxDatetoTimestampUTC("2025-11-00", "yyyy-MM-dd) -->
<#-- return "2025-11-00T00:00:00Z" -->
<#-- --------------------------------------------------------------------------------------- -->
<#-- Default timestamp to use in case of invalid date -->
<#assign DEFAULT_TIMESTAMP = "1970-01-01T00:00:00Z">
<#function RfxDatetoTimestampUTC rfxdate rfx_date_format >
<#local fallback = DEFAULT_TIMESTAMP>
<#if !rfxdate?matches("[0-9]*-[0-9]*-[0-9]*")>
<#return fallback>
</#if>
<#attempt>
<#if rfxdate?? && rfxdate == rfxdate?date(rfx_date_format)?string(rfx_date_format) >
<#return rfxdate?datetime(rfx_date_format)?iso_utc>,
<#else>
<#return fallback>
</#if>
<#recover>
<#return fallback>
</#attempt>
</#function>