DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Using datepicker in DotNetNuke-7 module

Sort:
You are not authorized to post a reply.





New Around Here





    I'm a DNN beginner. I am currently building a module in which I can display statistics. My DotNetNuke Version is 7.0. The statistic is from Chartjs. For this statistic I would like to implement filters. These filters should be datepickers. As UI element I have now included a textbox with `TextMode='Date'`. But currently I have problems to set the default value of this field. The default value should be `01.01`. of the current year. 

    I have already tried to set the value via C# server side. Unfortunately without success. I also tried to set the value on the client side via JavaScript. Unfortunately also without success.

    These are some lines I tried in JavaScript:

    document.getElementById(<%= this.DatumVon.AccessKey %>).value = "01.01.2019";
    document.getElementById(<%= this.DatumVon.AccessKey %>).innerText = "01.01.2019";
    document.getElementById("DatumVon".value = "01.01.2019";

    These are some lines I tried in C# in the method "Page_Load" (server side):

    this.DatumVon.Text = "01.01.2019";
     

    I expected the value of the TextBox to be `01.01.2019`. However, it currently only contains `dd.mmm.yyyy`. How can I change this?

    Thank you.






    Veteran Member





      As I answered here (https://stackoverflow.com...e/56645025#56645025) already - there seems to be something wrong with the localization. Please refer to the jQuery UI datepicker documentation (api.jqueryui.com/datepicker/ - the "Localization" section), this should give you the answer.

      Happy DNNing!
      Michael

      Michael Tobisch
      DNN★MVP

      dnnWerk Austria
      DNN Connect





      New Around Here





        I already tried the jQuery datepicker. But here is the problem that DNN 7.x is not compatible with it. It doesn't work with jQuery datepicker. Therefore I decided for a textbox with TextMode='Date'.





        Veteran Member





          As I posted in my comment on the Stackoverflow page, DNN is using the jQueryUI datepicker. It works fine for me.

          To get a German date format, you have to include the file "jquery.ui.datepicker-de.js" somehow - https://github.com/jquery...er/cdn/ui/1.8.8/i18n

          Happy DNNing!
          Michael

          Michael Tobisch
          DNN★MVP

          dnnWerk Austria
          DNN Connect
          You are not authorized to post a reply.

          These Forums are dedicated to the discussion of DNN Platform.

          For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

          1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
          2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
          3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
          4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
          5. No Flaming or Trolling.
          6. No Profanity, Racism, or Prejudice.
          7. Site Moderators have the final word on approving / removing a thread or post or comment.
          8. English language posting only, please.

          Would you like to help us?

          Awesome! Simply post in the forums using the link below and we'll get you started.

          Get Involved