dubrox / Multiple-Dates-Picker-for-jQuery-UI

MDP is a little plugin that enables jQuery UI calendar to manage multiple dates.
https://dubrox.github.io/Multiple-Dates-Picker-for-jQuery-UI
273 stars 159 forks source link

How do I localize the MDP #189

Closed trickinicki closed 7 years ago

trickinicki commented 8 years ago

Is it possible to localize your great tool?

Plaristote commented 7 years ago

I've done it once, so yes, definitely possible.

But... if in the past few months you've found the answer to this question, I'll take it. Because, though I have an example in which I can definitely see it being properly translated to Spanish, I cannot figure out for the life of me which piece of code is responsible for that.

I'll also keep this updated if I find out how the hell it works. I'm guessing it's more about jquery-ui than the MDP.

Plaristote commented 7 years ago

I've got the line responsible for the translation.

$.datepicker.setDefaults($.datepicker.regional['en']);

Apparently you can use this kind of source for jquery-ui.datepicker in order to have the proper locale:

<script type="text/javascript" src="/scripts/jquery.ui.datepicker-it.js"></script>
trickinicki commented 7 years ago

Sorry for ignoring your advice for such a log time. I'm not verry often in the github so I just missed it. The way you describe is working perfectly....

Thanks

valugi commented 6 years ago

Hi, Sorry to bring this up again, but I do not understand how to inject a locale into the MDP configuration. The example of @Plaristote is working directly with the datepicker object and not with the multiDatesPicker one.

Can you please clarify? Thanks

trickinicki commented 6 years ago

The code I used:

$(function () {
  $("#PublishFromBox").datepicker({
    dateFormat: "dd.mm.yy",
    regional: "de"
  });
valugi commented 6 years ago

@trickinicki this is not using the multiDatesPicker object, you modify directly in the plugin code?

trickinicki commented 5 years ago

Sorry abot that, got mixed up with another project... ... here the right One or just some sample Code out of it. The localization is in the events.js file. Datepicker Localized.zip