@@ -161,18 +161,6 @@ WHERE
161161 <!-- TO-DO: move to a better place. Does not take effect if typeahead is reset -->
162162 <ixsl : set-property object =" ." name =" autocomplete" select =" 'off'" />
163163 </xsl : template >
164-
165- <!-- inject datetime-local inputs (only if the input is visible) TO-DO: align structure of constructor and editing form controls -->
166- <xsl : template match =" input[not(@type = 'hidden')][@name = 'ol'][following-sibling::input[@name = 'lt'][@value = '&xsd;dateTime']] | input[@name = 'ol'][@value][../following-sibling::div/input[@name = 'lt'][@value = '&xsd;dateTime']]" mode =" ldh:RenderRowForm" priority =" 2" >
167- <ixsl : set-attribute name =" type" select =" 'datetime-local'" />
168- <ixsl : set-attribute name =" step" select =" '1'" />
169-
170- <xsl : if test =" @value" >
171- <!-- adjust the datetime value to the implicit (user's) timezone and format it to make it a legal datetime-local value: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#value -->
172- <xsl : variable name =" datetime-local" select =" format-dateTime(adjust-dateTime-to-timezone(xs:dateTime(@value)), '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]')" as =" xs:string" />
173- <ixsl : set-attribute name =" value" select =" $datetime-local" />
174- </xsl : if >
175- </xsl : template >
176164
177165 <!-- set focus on the first required input -->
178166 <xsl : template match =" fieldset//div[contains-token(@class, 'required')][1]//input" mode =" ldh:RenderRowForm" priority =" 1" >
@@ -195,11 +183,15 @@ WHERE
195183 <ixsl : remove-attribute name =" name" />
196184 </xsl : template >
197185
198- <!-- adjust datetime-local values to the implicit timezone -->
186+ <!-- append timezone to the datetime-local values -->
199187 <xsl : template match =" input[@type = 'datetime-local'][ixsl:get(., 'value')]" mode =" ldh:FormPreSubmit" priority =" 1" >
200188 <!-- set the input type back to 'text' because 'datetime-local' does not accept the timezoned value -->
201189 <ixsl : set-attribute name =" type" select =" 'text'" />
202- <ixsl : set-property name =" value" select =" string(adjust-dateTime-to-timezone(ixsl:get(., 'value')))" object =" ." />
190+
191+ <xsl : variable name =" timezone" select =" ixsl:get(following-sibling::input[contains-token(@class, 'input-timezone')], 'value')" as =" xs:string" />
192+ <!-- TO-DO: handle invalid timezone values -->
193+ <xsl : variable name =" timezoned-value" select =" xs:dateTime(ixsl:get(., 'value') || $timezone)" as =" xs:dateTime" />
194+ <ixsl : set-property name =" value" select =" $timezoned-value" object =" ." />
203195 </xsl : template >
204196
205197 <xsl : template name =" bs2:SignUpComplete" >
@@ -469,7 +461,7 @@ WHERE
469461 <xsl : variable name =" request-uri" select =" ldh:href($ldt:base, ac:absolute-path(ldh:base-uri(.)), map{}, $action)" as =" xs:anyURI" />
470462
471463 <!-- pre-process form before submitting it -->
472- <!-- < xsl:apply-templates select="." mode="ldh:FormPreSubmit"/> -- >
464+ <xsl : apply-templates select =" ." mode =" ldh:FormPreSubmit" />
473465
474466 <xsl : choose >
475467 <!-- we need to handle multipart requests specially because of Saxon-JS 2 limitations: https://saxonica.plan.io/issues/4732 -->
@@ -515,6 +507,9 @@ WHERE
515507
516508 <ixsl : set-style name =" cursor" select =" 'progress'" object =" ixsl:page()//body" />
517509
510+ <!-- pre-process form before submitting it -->
511+ <xsl : apply-templates select =" ." mode =" ldh:FormPreSubmit" />
512+
518513 <xsl : variable name =" elements" select =" .//input | .//textarea | .//select" as =" element()*" />
519514 <xsl : variable name =" triples" select =" ldh:parse-rdf-post($elements)" as =" element()*" />
520515 <!-- canonicalize XML in rdf:XMLLiterals -->
0 commit comments