You've already forked reflex-wms-connector
release2.0-SCPN1-11488 into release2.0
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user