VIVO-921: tweaked the regular expressions

This commit is contained in:
Tim Worrall 2015-04-01 13:36:53 -04:00
parent c47964fbde
commit 749a8ff8ad

View file

@ -19,12 +19,12 @@
<#if theValue?contains("<p>") > <#if theValue?contains("<p>") >
<#assign theValue = theValue?replace("<p>","<p style='margin-bottom:.6em'>") /> <#assign theValue = theValue?replace("<p>","<p style='margin-bottom:.6em'>") />
</#if> </#if>
<#if theValue?matches("^(10-20)\\d\\d[- \\/.](0[1-9]|1[012])[- \\/.](0[1-9]|[12][0-9]|3[01])$") > <#if theValue?matches("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})") >
<#assign theValue = theValue + "T00:00:00" /> <#assign theValue = theValue + "T00:00:00" />
${dt.formatXsdDateTimeLong(theValue, "yearMonthDayPrecision")} ${dt.formatXsdDateTimeLong(theValue, "yearMonthDayPrecision")}
<#elseif theValue?matches("^(10-20)\\d{2}(-|\\/)((0[1-9])|(1[0-2]))(-|\\/)((0[1-9])|([1-2][0-9])|(3[0-1]))(T|\\s)(([0-1][0-9])|(2[0-3])):([0-5][0-9]):([0-5][0-9])")> <#elseif theValue?matches("^([0-9]{4})-((0[1-9])|(1[0-2]))-((0[1-9])|([1-2][0-9])|(3[0-1]))(T|\\s)(([0-1][0-9])|(2[0-3])):([0-5][0-9]):([0-5][0-9])")>
${dt.formatXsdDateTimeLong(theValue, "yearMonthDayTimePrecision")} ${dt.formatXsdDateTimeLong(theValue, "yearMonthDayTimePrecision")}
<#elseif theValue?matches("^((10-20)\\d\\d+)-(0[1-9]|1[012])")> <#elseif theValue?matches("^([0-9]{4})-(0[1-9]|1[012])")>
<#assign theValue = theValue + "-01T00:00:00" /> <#assign theValue = theValue + "-01T00:00:00" />
${dt.formatXsdDateTimeLong(theValue, "yearMonthPrecision")} ${dt.formatXsdDateTimeLong(theValue, "yearMonthPrecision")}
<#elseif theValue?matches("^--(0[1-9]|1[012])")> <#elseif theValue?matches("^--(0[1-9]|1[012])")>