Copied to clipboard

Flag this post as spam?

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


  • Søren Reinke 158 posts 206 karma points c-trib
    Nov 16, 2010 @ 15:02
    Søren Reinke
    0

    Start Of Week in DatePicker

    Hi there

    In a Contour form i have 2 DatePicker's.

    How do i set them to use Monday as the start of the week.

    So that each week starts with a Monday at the left most position and not with Sunday ?

    The server and the browsers are running english languagem, but the users are Danish.

     

    Best regards

    Søren Reinke

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Nov 16, 2010 @ 15:15
    Sebastiaan Janssen
    0

    You should set a hostname on the root node of you website, with the hostname you also are required to add a language. If you make that language Danish then the calendar will be shown in the Danish locale.Languages are managed in the "Settings" section.

  • Søren Reinke 158 posts 206 karma points c-trib
    Nov 16, 2010 @ 15:45
    Søren Reinke
    0

    Thanks for your answer.

    I did as suggested, unfortunatly the website and usercontrol's are made by an external company, and some of it crashes now ;-(

    Is there any other way to get the DatePicker to 'talk' danish?

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Nov 16, 2010 @ 15:53
    Sebastiaan Janssen
    0

    What crashes? Any exceptions you can show? 

    But if it's their controls that crash, you should really ask them why the controls don't work when placed in a Danish locale. The locale is set in the "default .net way", so they would break in other non-umbraco sites as well, seems a bit odd to me.

  • Søren Reinke 158 posts 206 karma points c-trib
    Nov 22, 2010 @ 09:51
    Søren Reinke
    0

    Hi Sebastiaan

     

    Thanks for your answer, have been busy so not been able to answer.

    Gladly I have the source code for their implementation, so i'll fix the error myself (when i have the time).

     

    Thanks for your help.

  • Søren Reinke 158 posts 206 karma points c-trib
    Oct 25, 2011 @ 12:30
    Søren Reinke
    0

    Finally I got the time to fix this little problem, by using a 'hack'.

    In the masterpages code behind file i added the following code, and the DatePicker has monday as start of week :-)

     

    protected override void OnInit(EventArgs e)
            {
                var scriptManager = ScriptManager.GetCurrent(Page);
                if (scriptManager != null)
                {
                    scriptManager.EnableScriptGlobalization = true;
                    string Lang = "da-DK";//set your culture here
                    System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(Lang);
                }
            } 
    
  • Oscar Jurado 5 posts 25 karma points
    Nov 28, 2013 @ 20:42
  • 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