$(function() { $.datepicker.setDefaults($.datepicker.regional["ja"]); $("#hoge").datepicker( {//#以下はContact Form 7のフォームのIDを指定 autoSize: true,//テキストボックスの幅を自動設定 dateFormat: 'yy/mm/dd', minDate: '2025/02/24',//上記で判定した翌日・翌々日の日付を指定 maxDate: '2025/03/31',//営業終了日 beforeShowDay : function(date) {//以下、休業日設定をする日付を記載 var dateFormat = 'yy/mm/dd'; var disableDates = ["2025/01/02","2025/01/09","2025/01/16","2025/01/23","2025/01/30","2025/02/06","2025/02/13","2025/02/20","2025/02/27","2025/03/06","2025/03/13","2025/03/20","2025/03/27","2025/04/03","2025/04/10","2025/04/17","2025/04/24","2025/05/01","2025/05/08","2025/05/15","2025/05/22","2025/05/29","2025/06/05","2025/06/12","2025/06/19","2025/06/26","2025/07/03","2025/07/10","2025/07/17","2025/07/24","2025/07/31","2025/08/07","2025/08/14","2025/08/21","2025/08/28","2025/09/04","2025/09/11","2025/09/18","2025/09/25","2025/10/02","2025/10/09","2025/10/16","2025/10/23","2025/10/30","2025/11/06","2025/11/13","2025/11/20","2025/11/27","2025/12/04","2025/12/11","2025/12/18","2025/12/25","2025/12/29","2025/12/30","2025/12/31","2025/01/01","2025/01/02","2025/01/03","2025/01/04","2025/01/05","2025/01/06","2026/01/01","2026/01/02","2026/01/03","2026/01/04","2026/01/05","2026/01/06","2024/06/12","2024/08/12","2024/08/13","2024/08/14","2024/08/15","2026/01/01","2026/01/08","2026/01/15","2026/01/22","2026/01/29","2026/02/05","2026/02/12","2026/02/19","2026/02/26","2026/03/05","2026/03/12","2026/03/19","2026/03/26","2026/04/02","2026/04/09","2026/04/16","2026/04/23","2026/04/30","2026/05/07","2026/05/14","2026/05/21","2026/05/28","2026/06/04","2026/06/11","2026/06/18","2026/06/25","2026/07/02","2026/07/09","2026/07/16","2026/07/23","2026/07/30","2026/08/06","2026/08/13","2026/08/20","2026/08/27","2026/09/03","2026/09/10","2026/09/17","2026/09/24","2026/10/01","2026/10/08","2026/10/15","2026/10/22","2026/10/29","2026/11/05","2026/11/12","2026/11/19","2026/11/26","2026/12/03","2026/12/10","2026/12/17","2026/12/24","2026/12/31", ]; var disableDate = $.datepicker.formatDate(dateFormat, date); return [( disableDates.indexOf(disableDate) == -1 ), "", "営業日"]; } }); $('#hoge').attr('readonly',true);//#以下はContact Form 7のフォームのIDを指定 }); $(function() { $.datepicker.setDefaults($.datepicker.regional["ja"]); $("#service_date").datepicker( {//#以下はContact Form 7のフォームのIDを指定 autoSize: true,//テキストボックスの幅を自動設定 dateFormat: 'yy/mm/dd', minDate: '2025/03/01',//上記で判定した翌日・翌々日の日付を指定 maxDate: '2025/03/31',//営業終了日 beforeShowDay : function(date) {//以下、休業日設定をする日付を記載 var dateFormat = 'yy/mm/dd'; var disableDates = ["2025/01/02","2025/01/09","2025/01/16","2025/01/23","2025/01/30","2025/02/06","2025/02/13","2025/02/20","2025/02/27","2025/03/06","2025/03/13","2025/03/20","2025/03/27","2025/04/03","2025/04/10","2025/04/17","2025/04/24","2025/05/01","2025/05/08","2025/05/15","2025/05/22","2025/05/29","2025/06/05","2025/06/12","2025/06/19","2025/06/26","2025/07/03","2025/07/10","2025/07/17","2025/07/24","2025/07/31","2025/08/07","2025/08/14","2025/08/21","2025/08/28","2025/09/04","2025/09/11","2025/09/18","2025/09/25","2025/10/02","2025/10/09","2025/10/16","2025/10/23","2025/10/30","2025/11/06","2025/11/13","2025/11/20","2025/11/27","2025/12/04","2025/12/11","2025/12/18","2025/12/25","2025/12/29","2025/12/30","2025/12/31","2025/01/01","2025/01/02","2025/01/03","2025/01/04","2025/01/05","2025/01/06","2026/01/01","2026/01/02","2026/01/03","2026/01/04","2026/01/05","2026/01/06","2024/06/12","2024/08/12","2024/08/13","2024/08/14","2024/08/15","2026/01/01","2026/01/08","2026/01/15","2026/01/22","2026/01/29","2026/02/05","2026/02/12","2026/02/19","2026/02/26","2026/03/05","2026/03/12","2026/03/19","2026/03/26","2026/04/02","2026/04/09","2026/04/16","2026/04/23","2026/04/30","2026/05/07","2026/05/14","2026/05/21","2026/05/28","2026/06/04","2026/06/11","2026/06/18","2026/06/25","2026/07/02","2026/07/09","2026/07/16","2026/07/23","2026/07/30","2026/08/06","2026/08/13","2026/08/20","2026/08/27","2026/09/03","2026/09/10","2026/09/17","2026/09/24","2026/10/01","2026/10/08","2026/10/15","2026/10/22","2026/10/29","2026/11/05","2026/11/12","2026/11/19","2026/11/26","2026/12/03","2026/12/10","2026/12/17","2026/12/24","2026/12/31", ]; var disableDate = $.datepicker.formatDate(dateFormat, date); return [( disableDates.indexOf(disableDate) == -1 ), "", "営業日"]; } }); $('#hoge').attr('readonly',true);//#以下はContact Form 7のフォームのIDを指定 });