BuroRaDer / DateRangePicker

Extends the jQuery UI date picker with functionality to turn it into a date range picker
MIT License
2 stars 1 forks source link

Is there a way to add another language? #2

Closed Bagunda closed 2 years ago

Bagunda commented 2 years ago

Or how to edit words? Or how to setup calendar?

Bagunda commented 2 years ago

I understand!

In my HTML/PHP page:

<script type="text/javascript">
    $(function() {
      $("#pickup").datepicker({
        dateFormat: 'dd.mm.yy',
        maxDate: '+12M',
        monthNames: [ "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь" ],
        dayNames: [ "Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота" ],
        dayNamesMin: [ "ВС", "ПН", "ВТ", "СР", "ЧТ", "ПТ", "СБ" ],
        firstDay: 1
      });
      $("#single").datepicker({
        dateFormat: 'dd.mm.yy'
      });
      $("#pickup, #arrival, #single").click(function() {
        $(this).focus();
      });
      $("#return, #departure, #departure5").bind("click focus", function() {
        $($(this).data("date-range-start")).click();
      });
    });
</script>
fietserwin commented 2 years ago

You correctly found out how to do it. This date range picker is an extension to a normal date picker, so just pass in all settings (you want to override) of a normal date picker plus any of the date range picker specific settings you want to override.