{"id":3380,"date":"2021-06-15T14:36:17","date_gmt":"2021-06-15T05:36:17","guid":{"rendered":"https:\/\/taitan916.info\/blog\/?p=3380"},"modified":"2024-04-15T15:31:43","modified_gmt":"2024-04-15T06:31:43","slug":"post-3380","status":"publish","type":"post","link":"https:\/\/taitan916.info\/blog\/archives\/3380","title":{"rendered":"jQuery UI\u3067\u30ab\u30ec\u30f3\u30c0\u30fc\u30d4\u30c3\u30ab\u30fc(Datepicker)\u306e\u5229\u7528\u65b9\u6cd5"},"content":{"rendered":"<p>\u30d5\u30a9\u30fc\u30e0\u7b49\u3067\u65e5\u4ed8\u3092\u5165\u529b\u3059\u308b\u969b\u306b\u30ab\u30ec\u30f3\u30c0\u30fc\u30d4\u30c3\u30ab\u30fc\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u3002\u305d\u306e\u969b\u306f\u5927\u4f53<a href=\"https:\/\/xdsoft.net\/jqplugins\/datetimepicker\/\" target=\"_blank\" rel=\"noopener\">jQuery\u30d7\u30e9\u30b0\u30a4\u30f3\u306eDateTimePicker<\/a>\u3068\u3044\u3046\u3082\u306e\u3092\u5229\u7528\u3057\u3066\u3044\u305f\u3002\u305f\u3060\u3001\u4eca\u56de\u306f\u6a5f\u80fd\u7684\u306a\u554f\u984c\u3067jQuery UI\u306eDatepicker\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u306b\u306a\u3063\u305f\u306e\u3067\u4f7f\u3044\u65b9\u3092\u30e1\u30e2\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9<\/h2>\n<p><a href=\"https:\/\/js.studio-kingdom.com\/jqueryui\/widgets\/datepicker\" target=\"_blank\" rel=\"noopener\">https:\/\/js.studio-kingdom.com\/jqueryui\/widgets\/datepicker<\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>CDN\u547c\u3073\u51fa\u3057<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;script src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/2.0.3\/jquery.min.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"https:\/\/code.jquery.com\/ui\/1.12.1\/jquery-ui.min.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"https:\/\/rawgit.com\/jquery\/jquery-ui\/master\/ui\/i18n\/datepicker-ja.js\"&gt;&lt;\/script&gt;\r\n&lt;link rel=\"stylesheet\" href=\"https:\/\/code.jquery.com\/ui\/1.12.1\/themes\/base\/jquery-ui.css\"&gt;<\/pre>\n<p>&nbsp;<\/p>\n<h2>\u5404\u7a2e\u30bd\u30fc\u30b9&amp;\u30b5\u30f3\u30d7\u30eb<\/h2>\n<h3>\u30aa\u30d7\u30b7\u30e7\u30f3\u7121\u3057\u306e\u57fa\u672c\u7684\u306a\u547c\u3073\u51fa\u3057\u65b9<\/h3>\n<h4>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">$(\"#date\").datepicker({});<\/pre>\n<h4>\u30b5\u30f3\u30d7\u30eb<\/h4>\n<p><a href=\"https:\/\/taitan916.info\/sample\/jquery-ui-datepicker\/\" target=\"_blank\" rel=\"noopener\">https:\/\/taitan916.info\/sample\/jquery-ui-datepicker\/<\/a><\/p>\n<p>&nbsp;<\/p>\n<h3>\u5e74\u6708\u65e5\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u6307\u5b9a\u306e\u4e0a\u3067\u3001\u672c\u65e5\uff5e30\u65e5\u5f8c\u307e\u3067\u9078\u629e\u53ef\u80fd<\/h3>\n<h4>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">$(\"#date\").datepicker({\r\n    minDate: 0, \/\/\u6700\u5c0f\u306f\u672c\u65e5\u307e\u3067\r\n    maxDate: 30, \/\/\u6700\u5927\u306f30\u65e5\u5f8c\u307e\u3067\r\n    dateFormat: 'yy\/mm\/dd', \/\/\u5e74\u6708\u65e5\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\r\n});<\/pre>\n<p>minDate\u3084maxDate\u306f\u65e5\u4ed8\u6307\u5b9a\u3082\u53ef\u80fd\u3002<\/p>\n<h4>\u30b5\u30f3\u30d7\u30eb<\/h4>\n<p><a href=\"https:\/\/taitan916.info\/sample\/jquery-ui-datepicker\/index2.php\" target=\"_blank\" rel=\"noopener\">https:\/\/taitan916.info\/sample\/jquery-ui-datepicker\/index2.php<\/a><\/p>\n<p>&nbsp;<\/p>\n<h3>\u7279\u5b9a\u306e\u65e5\u306bClass\u4ed8\u4e0e&amp;\u9078\u629e\u4e0d\u53ef<\/h3>\n<h4>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/\u7279\u5b9a\u306e\u65e5\u6307\u5b9a\r\nvar sample_holiday = ['2021-06-23', '2021-07-01']\r\n\r\n$(\"#date\").datepicker({\r\n    minDate: 0, \/\/\u6700\u5c0f\u306f\u672c\u65e5\u307e\u3067\r\n    maxDate: 30, \/\/\u6700\u5927\u306f30\u65e5\u5f8c\u307e\u3067\r\n    dateFormat: 'yy-mm-dd', \/\/\u5e74\u6708\u65e5\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\r\n    beforeShowDay: function(date) {\r\n\r\n        \/\/\u7279\u5b9a\u306e\u65e5\u306bClass\u4ed8\u4e0e&amp;\u9078\u629e\u4e0d\u53ef\r\n        for (var i = 0; i &lt; sample_holiday.length; i++) {\r\n            var holiday = new Date(Date.parse(sample_holiday[i]));\r\n            if (holiday.getYear() == date.getYear() &amp;&amp;\r\n                holiday.getMonth() == date.getMonth() &amp;&amp;\r\n                holiday.getDate() == date.getDate()) {\r\n                return [false, 'sample_holiday', null];\r\n            }\r\n        }\r\n\r\n        return [true, 'day-weekday', null];\r\n    },\r\n});<\/pre>\n<p>\u7279\u5b9a\u306e\u65e5\u4ed8\u306bClass\u3092\u4ed8\u4e0e\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3068\u3044\u3046\u306e\u304c<a href=\"https:\/\/xdsoft.net\/jqplugins\/datetimepicker\/\" target=\"_blank\" rel=\"noopener\">jQuery\u30d7\u30e9\u30b0\u30a4\u30f3\u306eDateTimePicker<\/a>\u306b\u306f\u7121\u304b\u3063\u305f\u70ba\u3001\u4eca\u56dejQuery UI\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">[false, 'sample_holiday', null]<\/pre>\n<p>\u4e0a\u8a18\u306e\u7b2c1\u5f15\u6570\u90e8\u5206\u3067\u30ab\u30ec\u30f3\u30c0\u30fc\u306e\u9078\u629e\u53ef\u5426\u3092\u8a2d\u5b9a\u3001\u7b2c2\u5f15\u6570\u3067Class\u540d\u3092\u6307\u5b9a\u3067\u304d\u308b\u3002<\/p>\n<h4>\u30b5\u30f3\u30d7\u30eb<\/h4>\n<p><a href=\"https:\/\/taitan916.info\/sample\/jquery-ui-datepicker\/index3.php\" target=\"_blank\" rel=\"noopener\">https:\/\/taitan916.info\/sample\/jquery-ui-datepicker\/index3.php<\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>\u6240\u611f<\/h2>\n<p><a href=\"https:\/\/xdsoft.net\/jqplugins\/datetimepicker\/\" target=\"_blank\" rel=\"noopener\">jQuery\u30d7\u30e9\u30b0\u30a4\u30f3\u306eDateTimePicker<\/a>\u3067\u56f0\u3063\u305f\u6642\u306bGoogle\u691c\u7d22\u3059\u308b\u3068jQuery UI\u7248\u306e\u60c5\u5831\u304c\u30d2\u30c3\u30c8\u3059\u308b\u3053\u3068\u304c\u591a\u3044\u3002\u3053\u308c\u3092\u6a5f\u306bjQuery UI\u7248\u306b\u306e\u308a\u304b\u3048\u308b\u306e\u3082\u3042\u308a\u304b\u3068\u601d\u3063\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30d5\u30a9\u30fc\u30e0\u7b49\u3067\u65e5\u4ed8\u3092\u5165\u529b\u3059\u308b\u969b\u306b\u30ab\u30ec\u30f3\u30c0\u30fc\u30d4\u30c3\u30ab\u30fc\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u3002\u305d\u306e\u969b ... <\/p>\n","protected":false},"author":1,"featured_media":1071,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3,4],"tags":[100],"class_list":["post-3380","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jquery","category-javascript","tag-library"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/3380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/comments?post=3380"}],"version-history":[{"count":3,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/3380\/revisions"}],"predecessor-version":[{"id":5506,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/3380\/revisions\/5506"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media\/1071"}],"wp:attachment":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media?parent=3380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/categories?post=3380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/tags?post=3380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}