Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
16.10.2
-
None
-
None
-
Microsoft Windows Server 2022 Standard x64
-
Unknown
-
Description
The date converter and the date picker donot appear to use the same string format.
I guess this never got logged: https://forum.xwiki.org/t/type-date-not-working-with-wikimacro-parameters/12252
I'm having some additional goofiness where it isn't respecting my parameter name. Despite my parameter being named "yo" the parameter shows up in $wikimacro.parameters.getParameterNames() as "Date". It's type is String, which is why formatting it wasn't working I guess. Ironically if I name the parameter "date" it doesn't show up at all.
Here is my parameter:
Here is my macro code:
{{velocity}} $datetool.getClass() datetool #[[=]]# $datetool $wikimacro.parameters.getParameterNames() $wikimacro.parameters.date.getClass() wikimacro.parameters.date #[[=]]# $wikimacro.parameters.date #if($wikimacro.parameters.date) $datetool.format($wikimacro.parameters.date) #else {{error}}Select Date{{/error}} #end {{/velocity}}
Here is my result after I select today's date:
class org.xwiki.velocity.internal.XWikiDateTool datetool = Apr 3, 2025, 3:38:28 PM [Date] class java.lang.String wikimacro.parameters.date = 2025/04/03 15:01 $datetool.format($wikimacro.parameters.date)