/// <summary> /// Implements the following function /// string date:day-name() /// </summary> /// <returns>The name of the current day</returns> public static string dayname(){ return DateTime.Now.DayOfWeek.ToString(); }
/// <summary> /// Implements the following function /// string date:day-name(string) /// </summary> /// <returns>The name of the day of the specified date or the empty string if the /// date is invalid</returns> public static string dayname(string d){ try{ DateTime date = DateTime.Parse(d); return date.DayOfWeek.ToString(); }catch(FormatException){ return ""; } }
Multilingual dayname
I'm bulding a new blog in umbraco and would like to use the dayname() method to display the name of the post date.
http://wifi.umbraco.org/wiki/reference/exslt/exsltexsltdatesandtimes/dayname
It works just fine, but no matter what language i'm using on the site, the dayname() method shows the dayname in english.
Is the dayname() method not prepared to multilingual sites ?
No, it's not...
http://msdn.microsoft.com/en-us/library/system.datetime.dayofweek.aspx
Here is the umbraco implementation:
is working on a reply...