Copied to clipboard

Flag this post as spam?

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


  • Claushingebjerg 830 posts 2144 karma points
    Apr 22, 2015 @ 15:40
    Claushingebjerg
    0

    localizing datepicker type

    How do i localize the date picker form element?

    Mys site is in Danish and set to use Danish. (other dates render correctly).

    When picking a date with the "Contour" date picker it retuns the date in american date format, and with months and days in english... Month headers on the calendar are in english too.

  • Dennis Aaen 4432 posts 17885 karma points admin hq c-trib
    Apr 22, 2015 @ 16:21
    Dennis Aaen
    0

    Hi Claus,

    If you are using Contour try have a look at this post https://our.umbraco.org/forum/umbraco-pro/contour/37552-Date-picker-format on how to change the date format for the datepicker type.

    Hope this helps,

    /Dennis

  • Claushingebjerg 830 posts 2144 karma points
    Apr 22, 2015 @ 16:26
    Claushingebjerg
    0

    Im using the new forms in 7.2.4... And the site is set to use danish as culture.

    As i mentioned, i have dates in other places on the site, and they render correctly.

     

  • Claushingebjerg 830 posts 2144 karma points
    Apr 22, 2015 @ 16:46
    Claushingebjerg
    0

    OK. So i went and changed some lines in /App_Plugins/UmbracoForms/Assets/pikaday/pikaday.js

            i18n: {
                previousMonth: 'Previous Month',
                nextMonth: 'Next Month',
                months: ['Januar', 'Februar', 'Marts', 'April', 'Maj', 'Juni', 'July', 'August', 'September', 'Oktober', 'November', 'December'],
                weekdays: ['Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag'],
                weekdaysShort: ['Søn', 'Man', 'Tir', 'Ons', 'Tor', 'Fre', 'Lør']
            },

    Now the calendar is in Danish, but when picking a date, the text is written like this:

    Wed Apr 22 2015

    Where do i fix this?

  • Dennis Aaen 4432 posts 17885 karma points admin hq c-trib
    Apr 22, 2015 @ 16:49
    Dennis Aaen
    0

    Hi Claus,

    Okay, Maybe this post can help you further https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/63876-Umbraco-72-Forms-403-Change-Date-in-FRONT-END-date-picker

    The files that Lachlann are talking about is located here: /App_Plugins/UmbracoForms/Assets

    Hope this helps,

    /Dennis

  • Jan Skovgaard 11241 posts 23387 karma points MVP 6x admin c-trib
    Apr 22, 2015 @ 16:50
    Jan Skovgaard
    0

    Hi Claus

    Has the site been setup with a danish culture hostname?

    /Jan

  • Claushingebjerg 830 posts 2144 karma points
    Apr 23, 2015 @ 09:27
    Claushingebjerg
    0

    Jan: Yes as mentioned above the site culture is danish, and other dates set in the views display correctly.

  • Claushingebjerg 830 posts 2144 karma points
    Apr 23, 2015 @ 09:48
    Claushingebjerg
    0

    Ok, so i installed moments.js, and it got me a little further. Now im getting the date as number...

    But still in the american format...
    I tried changing

    val = d.ToShortDateString();

    to

    val = d.ToString("dd.MM.yyyy"); 

    in /Views/Partials/Forms/Fieldtypes/FieldType.DatePicker.cshtml. But that made no difference...

    For being "Easy forms" this is pretty hard :(

  • Rick van der Meij 35 posts 135 karma points
    May 07, 2015 @ 13:01
    Rick van der Meij
    0

    Any updates so far? as far as I can see 'moments.min.js' inside the umbracoForms folder is not being used, when you import a form as a macro. same problem: https://our.umbraco.org/forum/umbraco-pro/contour/61213-Umbraco-Forms-Pikaday-Moment-working

Please Sign in or register to post replies

Write your reply to:

Draft