0

I'm using Django and I'm using 4 datepickers one page. Currently, 4 calendars can be selected year, month, and day. I want to adjust only the 2 datepickers here to show only year and month. #from_month_date_full.ui-datepicker-calendar: none; does not apply. How to apply ui-calendar-display only to datepicker with ids #from-month_date_full and #to_month_date_full ?

<script src="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.12.1/jquery-ui.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css"></script>


  $(function() {
  $( "#fromDate, #toDate" ).datepicker({
    dateFormat: "yy-mm-dd"
  });
  $('#from_month_date_full, #to_month_date_full').datepicker({
      showMonthAfterYear:true,
      monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
      altField: '#from_month_date',
      altFormat: 'yy-mm-dd',
      changeMonth: true,
      changeYear: true,
      dateFormat: 'yy-mm-dd',
      showAnim: 'slideDown',
      yearRange: '-10:+0',
      onChangeMonthYear:function(y, m, i){
          var d = i.selectedDay;
          $(this).datepicker('setDate', new Date(y, m-1, 1));
          $('#to_month_date_full').datepicker('setDate', new Date(y, m, 0))
      }
  });
  });
leesuccess
  • 141
  • 10
  • I tried to convert your question to a running snippet, but it didn't work. I checked the devtools console, and I saw an error about the CSS file. Checking your code, you have the CSS linked as a ` – Don't Panic Sep 03 '21 at 06:58
  • Does this answer your question? [Multiple jQuery UI date pickers with different styling](https://stackoverflow.com/questions/3311249/multiple-jquery-ui-date-pickers-with-different-styling) – Don't Panic Sep 04 '21 at 07:57

0 Answers0