Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Anders Dahl Tollestrup 73 posts 52 karma points
    Feb 11, 2011 @ 16:09
    Anders Dahl Tollestrup

    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.

    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 ?


  • Tobias Morf 80 posts 183 karma points
    Feb 11, 2011 @ 16:46
    Tobias Morf

    No, it's not...

    Here is the umbraco implementation:

      /// <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){
        DateTime date = DateTime.Parse(d);
        return date.DayOfWeek.ToString();
        return "";
Please Sign in or register to post replies

Write your reply to: