Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am trying to output a date from a property using Xslt. The page I am outputting is Danish, but the server has a US English locale. So when I use
<xsl:value-of select="umbraco.library:FormatDateTime($currentPage/data [@alias = 'eventStartDate'],'MMMM d, yyyy')"/>
I get a date that looks like this: July 12, 2010
I would like that to be displayed as the Danish string 12. juli 2010. instread.
I looked at the ShortDateWithGlobal method using the da-DK culture. But that doesn't give me the a month name. It just displays like this 12-01-2010.
Any input on how to display this correctly? I was thinking about creating a template to handle this, but figured that the Umbraco library would have a method to handle this.
I think you have 2 options here. Instead of 'MMMM d, yyyy' try 'dd MMMM yyyy'
Alternatively, you could add your da-culture to the web.config which will cause the dates to behave as Danish.
(And thirdly, you could try setting a language to your home-node)
Ok, strike the first option as the monthnames don't match....sorry for that
Have you thought about using the dictionary for your date formats? I assume your site is in multiple languages as is?
I ended up changing the globalization tag in the web.config.
For the moment I only have one language on the website and that is Danish. So that works for now. But I would have liked to be able to do that on the method call itself. Because I plan to do this in multiple languages.
In case of multi-language, you can assign multiple hostnames to the root (if you have seperate hostnames for each language), each having its own language assigned to it. That should work as well.
Hi, my problem looks like rasb's one. My entire site is in french, but when I use FormatDateTime it gives me english name of months. July instead of Juillet for instance. The first and third ideas of Peter doesn't change anything. So I want to try the second one, but what do I have to change in my web.config file? I already look the globalization tag and it gives me UTF-8, which is the enconding I want.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted