2

I am completely new to jQuery.

I am trying to use jQuery datepicker for my HTML form. In the English language datepicker displaying as it should. But when I tried to change the language to slovak according to tutorials on the web, datepicker stop displaying and I don't know why at this point. Maybe I am missing something easy, but I looking for answers for 2 hours now and nothing seems to work. Here is my code:

Head:

    <script src='jquery-3.2.1.min.js' type='text/javascript'></script>
    <link href='jquery-ui.min.css' rel='stylesheet' type='text/css'>
    <script src='jquery-ui.min.js' type='text/javascript'></script>
    <script src='datepicker-sk.js' type='text/javascript'></script>

HTML:

<input type='text' id='datepicker' ><br/>

JS:

$(function ($) {
    $("#datepicker").datepicker(
       {
          language: "sk",
          format: "dd.mm.yyyy",
          startDate: new Date()
       });
});

This renders a text field, but no jQuery calendar in the Slovak language.

2
  • <script src='datepicker-sk.js' type='text/javascript'></script> it is maybe just include i18n conversions. Can you try to before it, include original file? <script src='datepicker.js' type='text/javascript'></script><script src='datepicker-sk.js' type='text/javascript'></script> Commented Nov 17, 2020 at 18:18
  • Still not working :/ Commented Nov 17, 2020 at 18:30

1 Answer 1

1

It looks like you have everything correct, except the SK JS file must be wrong.

I used this one here (Note: you can copy the code and include it in your local file):

https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.9.2/i18n/jquery.ui.datepicker-sk.min.js

Here is an example of this working:

https://jsfiddle.net/bradberkobien/da97kp8g/21/

You can see that I included all of the files from your head in the exact order

enter image description here

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you very much :) Now it's working as it should. I knew that I missing something trivial.
Will you mark it as the solution @webismypassion 😊
Done :) Thank you once again

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.