Copied to clipboard

Flag this post as spam?

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


  • Jonas Gunnarsson 44 posts 194 karma points
    Apr 26, 2013 @ 07:26
    Jonas Gunnarsson
    0

    Need help with Swedish date format

    Hi,
    I would like to have the archive in Swedish like:
    Arkiv
    2013
      Mars
      Februari
      Januari
    2012
      December
      November
      so on...
      so on...

    I tried this, but it doesn't work, nothing happens. 
    Web.Config
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" responseHeaderEncoding="utf-8" culture="sv-SE" />
     
    [uBlogsy] [Base] Site
    <html lang="sv-SE" xmlns="http://www.w3.org/1999/xhtml" xml:lang="sv-SE" dir="ltr">
    uBlogsyWidgetListPostArchive.cshtml
    <li class="@yearClass"><a class="uBlogsy_year_name" href="#"><span>@currentYear</span></a>
                            @*render year name*@
                            <ul class="uBlogsy_months">
                                @for (; index < nodes.Count(); index++)
                                {
                                    node = nodes[index];
    
                                    date = DateTime.Parse(node.GetValue("uBlogsyPostDate"));
    
                                    var currentMonth = date.Month;
    
                                    if (date.Year != currentYear) { break; }
    
                                    // render month
                                    <li class="uBlogsy_month"><a class="uBlogsy_month_name" href="#"><span>@DateHelper.GetMonthName(currentMonth,false)</span>
                                    </a>@*render month name*@
                                        <ul class="uBlogsy_post_items">
                                            @RenderPosts(nodes, currentYear, currentMonth)
                                        </ul>
                                    </li>
                                }
                            </ul>
                        </li>
    And this (nothing happens):
    date = DateTime.Parse(node.GetValue("uBlogsyPostDate"), new System.Globalization.CultureInfo("sv-SE", true));
    And this (With this result: 0v-SE):
    @DateHelper.GetMonthNameWithFormat(currentMonth, new System.Globalization.CultureInfo("sv-SE").ToString())

    As you can see I´am just guessing and have no idea what I'm doing and really need some help :-)

    Thanks!
  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Apr 26, 2013 @ 14:21
  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Apr 26, 2013 @ 14:22
    Anthony Dang
    0

    Also, if you dont want months as words you can change the format in udatefoldersy.config

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies