Open Timo-Breumelhof opened 5 years ago
The problem is that server side it use dot.Net datetime format and is hardcoded.
And clientside, it use helpers defined in the template.js and by default use momentjs wich use other format strings. If you can find a js library that match dotnet format string, we can harmonize...
ah, ok
did find a C# option ;-) https://gist.github.com/spooky/5546120
Maybe this plugin is an option, seems to do the same: https://momentjs.com/docs/#/plugins/jdateformatparser/ ?
My preference goes to do the transformation in js because the dotNet part is hardcoded and the documentation is based on the dotNet format.
We can start doing it in the articles templates js file.
I think the JAVA format converter could work, right?
The fact that {{formatDateTime Startdatum "D MMM" "nl-NL"}}
, in a clientside template, does NOT give a desired result is related to this? It returns 20 May
and the desired result is 20 mei
. Is there a solution or workaround?
@b-creative I don't think it is
Adding {{registerscript "/DesktopModules/OpenContent/js/lib/moment/locale/nl.js"}}
in template.hbs and changing the call in item.hbs into {{formatDateTime Startdatum "D MMM" "nl"}}
helped me!
I noticed that in a server side template I need to use this:
And in a Client side template: {{formatDateTime publishstartdate "DD-MM-YYYY"}}
To get 15-05-2019 as a result.
If i use {{formatDateTime publishstartdate "DD-MM-YYYY"}} in a server side template, the result is DD-15-yyyy
This is with OC 04.01.00