Copied to clipboard

Flag this post as spam?

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


  • Rick van der Meij 35 posts 135 karma points
    Feb 10, 2015 @ 12:38
    Rick van der Meij
    0

    Umbraco Forms Pikaday & Moment working?

    Hi,

    I am trying to get another language working for a date picker (pikaday), when i'm trying to debug, i see moment.min.js is undefined (see screenshot)

    I've tried to manually rename dates in pikaday, but still not working.

    moment.min.js not defined

    input field english

    as you can see, the calendar is optimized for another language (dutch), but the input field still sets another format.

    Where can i find the format, to change it, or how can I include this file to get it working properly. https://github.com/MatthewWilkes/django-pikaday/blob/master/djpikaday/static/moment/lang/nl.js

  • Bart Kuijpers 2 posts 22 karma points
    Feb 19, 2015 @ 16:33
    Bart Kuijpers
    0

    Hi,

    We have the exact same problem, we have no clue where pikaday.js is added, moment.js is not found to set a moment. I'm very curious about a solution.


  • Rick van der Meij 35 posts 135 karma points
    Feb 20, 2015 @ 08:31
    Rick van der Meij
    0

    pikaday is set in the App_plugins>Assets. Still haven't figured it out yet.

  • Yakov Lebski 590 posts 2344 karma points
    Oct 08, 2015 @ 00:08
    Yakov Lebski
    0

    I solve this issue by add moment.js with localization on site layout.

  • GTona 6 posts 76 karma points
    Dec 18, 2015 @ 14:52
    GTona
    0

    Hi Yakov, can you share the solution details? Thanks G.

  • Yakov Lebski 590 posts 2344 karma points
    Dec 18, 2015 @ 15:50
    Yakov Lebski
    0

    Add script reference like ~/scripts/moment-with-locales.js you can download file from http://momentjs.com/

  • GTona 6 posts 76 karma points
    Dec 21, 2015 @ 14:39
    GTona
    0

    Thanks for your replay, but this did not solve the problem. Still Pickaday has default values.

  • Jens Qvist 1 post 72 karma points
    Aug 24, 2016 @ 08:24
    Jens Qvist
    1

    Open up \Views\Partials\Forms\Script.cshtml

    Add

       <script src="@Url.Content("~/App_Plugins/UmbracoForms/Assets/moment/min/moment-with-locales.min.js")" type="text/javascript"></script>
    

    under the 2 other scripts umbracoforms-conditions.js Should look like this;

        <script src="@Url.Content("~/App_Plugins/UmbracoForms/Assets/umbracoforms.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/App_Plugins/UmbracoForms/Assets/umbracoforms-conditions.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/App_Plugins/UmbracoForms/Assets/moment/min/moment-with-locales.min.js")" type="text/javascript"></script>
    

    Boom, you have moment.

    Next step is to change the default format in pikaday.js file located in "/App_Plugins/UmbracoForms/Assets/pikaday/".

        defaults = {
    
        field: null,
        bound: undefined,
        position: 'bottom left',
    
        // CHANGE THIS FORMAT
        format: 'YYYY-MM-DD',
    

    Once you have moment you can change the default format for output by changing the format value under "defaults" to something else. that value will change what you see in field once you have chosen a date.

  • Simon Jackson 11 posts 31 karma points
    Sep 14, 2016 @ 10:22
    Simon Jackson
    0

    I have moment-with-locales.min.js and have the format set

     format: 'DD/MM/YYYY',
    

    This works on most browsers unfortunately some browsers (old version of firefox) are still giving dates of "Thu Sep 22 2016" as the date.

    This is a production issue for us :-(

    Any other ideas?

Please Sign in or register to post replies

Write your reply to:

Draft