luxx
luxx

Reputation: 59

jQuery datepicker not displaying after trying to change the language

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.

Upvotes: 2

Views: 166

Answers (1)

berkobienb
berkobienb

Reputation: 714

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

Upvotes: 1

Related Questions