Copied to clipboard

Flag this post as spam?

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


  • Kristoffer Eriksen 185 posts 465 karma points
    Apr 01, 2014 @ 09:42
    Kristoffer Eriksen
    0

    Localize Datepicker with time, in Umbraco Backend

    Hey

    I have a Datepicker with time, that I want to localize to the current umbraco user login language

    I'm using Umbraco v6.1.3 (Assembly version: 1.0.4954.19342) and primarily I want it to start with monday.

    I'm logged on with a danish umbraco user, and set the hostname and language to danish.

    But nothing works.

    I tried to change 

     $(this).datepicker({
                    duration: "",
                    showTime: showTime,
                    constrainInput: true,
                    buttonText: "<span>" + chooseDateTxt + "</span>",
                    showOn: 'button',
                    changeYear: true,
                    dateFormat: 'yy-mm-dd',
                    time24h: true,
                    firstDay: 1,
                    onClose: function(dateText, inst) { if (dateText == '') return; $(this).nextAll('div').remove(); }
                });

    in the umbDateTimePicker.js but that didn't help

    I've searched the forum, but didn't find any valid solutions.

    Any suggestions would be highly appreciated

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 01, 2014 @ 10:37
    Jan Skovgaard
    0

    Hi Kristoffer

    I think this may have been overlooked when doing the localization. I think the best you can do is to file it as a bug report on http://issues.umbraco.org/issues

    I know it does not solve your issue straight away but this makes the HQ aware of it at least.

    I have not had a look at the integration of the datepicker but you probably should finde the danish localization file by googling for it. I found this site http://jquery-ui.googlecode.com/svn/tags/1.6rc5/demos/datepicker/localization.html and you can grab the danish file from viewing the source - but usually it's easier to find.

    If you know how to do it an option could perhaps be to add this as a custom datatype where you're using the localized danish version instead? (If you don't have to worry about users of others nationalities).

    Hope this helps.

    /Jan

  • Kristoffer Eriksen 185 posts 465 karma points
    Apr 01, 2014 @ 11:13
    Kristoffer Eriksen
    0

    Hey Jan

    It is not so much the language but the startdate that is most important

    And that seem to work on the demosite as well

  • Kristoffer Eriksen 185 posts 465 karma points
    Apr 01, 2014 @ 12:29
    Kristoffer Eriksen
    2

    Haven't had enough coffee yet....

    This issue was pretty stupid, but when you change it local, and test it in production, no wonder it doesn't have an effect :-(

    Anyways. Problem solved, by changing and testing in the same solution. Sorry....

    In the /umbraco_client/datetimepicker/umbDateTimePicker.js I've added the following.

    It will solve the customers needs, since they just want danish in the backend.

     $(this).datepicker({
                        duration: "",
                        showTime: showTime,
                        constrainInput: true,
                        buttonText: "<span>" + chooseDateTxt + "</span>",
                        showOn: 'button',
                        changeYear: true,
                        dateFormat: 'yy-mm-dd',
                        time24h: true,
                        closeText: 'Luk',
                        prevText: '&#x3c;Forrige',
                        nextText: 'Næste&#x3e;',
                        currentText: 'Idag',
                        monthNames: ['Januar', 'Februar', 'Marts', 'April', 'Maj', 'Juni',
                        'Juli', 'August', 'September', 'Oktober', 'November', 'December'],
                        monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun',
                        'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'],
                        dayNames: ['Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag'],
                        dayNamesShort: ['Søn', 'Man', 'Tir', 'Ons', 'Tor', 'Fre', 'Lør'],
                        dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
                        weekHeader: 'Uge',
                        firstDay: 1,
                        isRTL: false,
                        showMonthAfterYear: false,
                        yearSuffix: '',
                        onClose: function(dateText, inst) { if (dateText == '') return; $(this).nextAll('div').remove(); }
                    });
Please Sign in or register to post replies

Write your reply to:

Draft