{"id":53358,"date":"2024-12-03T13:20:52","date_gmt":"2024-12-03T05:20:52","guid":{"rendered":"https:\/\/fwq.ai\/blog\/53358\/"},"modified":"2024-12-03T13:20:52","modified_gmt":"2024-12-03T05:20:52","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-eonasdan-bootstrap-datetimepicker-%e5%9c%a8%e7%a6%81%e7%94%a8%e6%9f%90%e4%ba%9b%e6%98%9f%e6%9c%9f%e5%87%a0%e7%9a%84%e6%83%85%e5%86%b5%e4%b8%8b%e6%8c%87%e5%ae%9a-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/53358\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 eonasdan-bootstrap-datetimepicker \u5728\u7981\u7528\u67d0\u4e9b\u661f\u671f\u51e0\u7684\u60c5\u51b5\u4e0b\u6307\u5b9a\u5141\u8bb8\u9009\u62e9\u7684\u7279\u5b9a\u65e5\u671f\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5982\u4f55\u4f7f\u7528 eonasdan-bootstrap-datetimepicker \u5728\u7981\u7528\u67d0\u4e9b\u661f\u671f\u51e0\u7684\u60c5\u51b5\u4e0b\u6307\u5b9a\u5141\u8bb8\u9009\u62e9\u7684\u7279\u5b9a\u65e5\u671f\uff1f<\/h1>\n<p>\u6765\u5230\u7c73\u4e91\u7684\u5927\u5bb6\uff0c\u76f8\u4fe1\u90fd\u662f\u7f16\u7a0b\u5b66\u4e60\u7231\u597d\u8005\uff0c\u5e0c\u671b\u5728\u8fd9\u91cc\u5b66\u4e60\u6587\u7ae0\u76f8\u5173\u7f16\u7a0b\u77e5\u8bc6\u3002\u4e0b\u9762\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u5e26\u5927\u5bb6\u804a\u804a\u300a\u5982\u4f55\u4f7f\u7528 eonasdan-bootstrap-datetimepicker \u5728\u7981\u7528\u67d0\u4e9b\u661f\u671f\u51e0\u7684\u60c5\u51b5\u4e0b\u6307\u5b9a\u5141\u8bb8\u9009\u62e9\u7684\u7279\u5b9a\u65e5\u671f\uff1f\u300b\uff0c\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u77e5\u8bc6\u79ef\u7d2f\u6709\u6240\u5e2e\u52a9\uff0c\u52a9\u529b\u5b9e\u6218\u5f00\u53d1\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241129\/173287371967498df772405.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 eonasdan-bootstrap-datetimepicker \u5728\u7981\u7528\u67d0\u4e9b\u661f\u671f\u51e0\u7684\u60c5\u51b5\u4e0b\u6307\u5b9a\u5141\u8bb8\u9009\u62e9\u7684\u7279\u5b9a\u65e5\u671f\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 eonasdan-bootstrap-datetimepicker \u5728\u7981\u7528\u67d0\u4e9b\u661f\u671f\u51e0\u7684\u60c5\u51b5\u4e0b\u6307\u5b9a\u5141\u8bb8\u9009\u62e9\u7684\u7279\u5b9a\u65e5\u671f\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>eonasdan-bootstrap-datetimepicker\uff1adaysofweekdisabled \u548c enableddates \u8054\u5408\u4f7f\u7528\u95ee\u9898<\/strong><\/p>\n<p>\u4f7f\u7528 eonasdan \u5f00\u53d1\u7684 bootstrap-datetimepicker \u65f6\uff0c\u5728\u542f\u7528 daysofweekdisabled \u9009\u9879\u65f6\uff0cenableddates \u9009\u9879\u4e0d\u8d77\u4f5c\u7528\uff0c\u5bfc\u81f4\u65e0\u6cd5\u5728\u7981\u7528\u67d0\u4e9b\u661f\u671f\u51e0\u7684\u540c\u65f6\u6307\u5b9a\u5141\u8bb8\u9009\u62e9\u7684\u7279\u5b9a\u65e5\u671f\u3002<\/p>\n<p>\u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u9700\u8981\u4f7f\u7528 reenableddates \u9009\u9879\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre>$('#visit_date').datetimepicker({\n  locale: currentCultureName,\n  minDate: moment().add(1, 'days').hours(9).startOf('hour'),\n  format: 'YYYY\/MM\/DD hh:mm',\n  daysOfWeekDisabled: [1],\n  enabledDates: [moment('2018\/01\/08', 'YYYY\/MM\/DD')],\n  reenabledDates: [moment('2018\/01\/08', 'YYYY\/MM\/DD')]\n});<\/pre>\n<p>\u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u4e5f\u5c31\u8bb2\u5b8c\u4e86\u300a\u5982\u4f55\u4f7f\u7528 eonasdan-bootstrap-datetimepicker \u5728\u7981\u7528\u67d0\u4e9b\u661f\u671f\u51e0\u7684\u60c5\u51b5\u4e0b\u6307\u5b9a\u5141\u8bb8\u9009\u62e9\u7684\u7279\u5b9a\u65e5\u671f\uff1f\u300b\u7684\u5185\u5bb9\u4e86\u3002\u4e2a\u4eba\u8ba4\u4e3a\uff0c\u57fa\u7840\u77e5\u8bc6\u7684\u5b66\u4e60\u548c\u5de9\u56fa\uff0c\u662f\u4e3a\u4e86\u66f4\u597d\u7684\u5c06\u5176\u8fd0\u7528\u5230\u9879\u76ee\u4e2d\uff0c\u6b22\u8fce\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u5e26\u4f60\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u77e5\u8bc6\u70b9\uff01<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   \u5982\u4f55\u89e3\u51b3\u7535\u8111\u65e0\u6cd5\u641c\u7d22\u5230\u84dd\u7259\u8bbe\u5907\u7684\u95ee\u9898\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528 eonasdan-bootstrap-datetimepicker \u5728\u7981\u7528\u67d0\u4e9b\u661f\u671f\u51e0\u7684\u60c5\u51b5\u4e0b\u6307\u5b9a\u5141\u8bb8\u9009\u62e9\u7684\u7279\u5b9a\u65e5\u671f\uff1f \u6765\u5230\u7c73\u4e91\u7684\u5927\u5bb6\uff0c\u76f8\u4fe1\u90fd\u662f\u7f16\u7a0b\u5b66\u4e60\u7231\u597d\u8005\uff0c\u5e0c\u671b\u5728\u8fd9\u91cc\u5b66\u4e60\u6587\u7ae0\u76f8\u5173\u7f16\u7a0b\u77e5\u8bc6\u3002\u4e0b\u9762\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u5e26\u5927\u5bb6\u804a\u804a\u300a\u5982\u4f55\u4f7f\u7528 eonasdan-bootstrap-datetimepicker \u5728\u7981\u7528\u67d0\u4e9b\u661f\u671f\u51e0\u7684\u60c5\u51b5\u4e0b\u6307\u5b9a\u5141\u8bb8\u9009\u62e9\u7684\u7279\u5b9a\u65e5\u671f\uff1f\u300b\uff0c\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u77e5\u8bc6\u79ef\u7d2f\u6709\u6240\u5e2e\u52a9\uff0c\u52a9\u529b\u5b9e\u6218\u5f00\u53d1\uff01 eonasdan-bootstrap-datetimepicker\uff1adaysofweekdisabled \u548c enableddates \u8054\u5408\u4f7f\u7528\u95ee\u9898 \u4f7f\u7528 eonasdan \u5f00\u53d1\u7684 bootstrap-datetimepicker \u65f6\uff0c\u5728\u542f\u7528 daysofweekdisabled \u9009\u9879\u65f6\uff0cenableddates \u9009\u9879\u4e0d\u8d77\u4f5c\u7528\uff0c\u5bfc\u81f4\u65e0\u6cd5\u5728\u7981\u7528\u67d0\u4e9b\u661f\u671f\u51e0\u7684\u540c\u65f6\u6307\u5b9a\u5141\u8bb8\u9009\u62e9\u7684\u7279\u5b9a\u65e5\u671f\u3002 \u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u9700\u8981\u4f7f\u7528 reenableddates \u9009\u9879\uff0c\u5982\u4e0b\u6240\u793a\uff1a $(&#8216;#visit_date&#8217;).datetimepicker({ locale: currentCultureName, minDate: moment().add(1, &#8216;days&#8217;).hours(9).startOf(&#8216;hour&#8217;), format: &#8216;YYYY\/MM\/DD hh:mm&#8217;, daysOfWeekDisabled: [1], enabledDates: [moment(&#8216;2018\/01\/08&#8217;, &#8216;YYYY\/MM\/DD&#8217;)], reenabledDates: [moment(&#8216;2018\/01\/08&#8217;, &#8216;YYYY\/MM\/DD&#8217;)] }); \u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u4e5f\u5c31\u8bb2\u5b8c\u4e86\u300a\u5982\u4f55\u4f7f\u7528 eonasdan-bootstrap-datetimepicker \u5728\u7981\u7528\u67d0\u4e9b\u661f\u671f\u51e0\u7684\u60c5\u51b5\u4e0b\u6307\u5b9a\u5141\u8bb8\u9009\u62e9\u7684\u7279\u5b9a\u65e5\u671f\uff1f\u300b\u7684\u5185\u5bb9\u4e86\u3002\u4e2a\u4eba\u8ba4\u4e3a\uff0c\u57fa\u7840\u77e5\u8bc6\u7684\u5b66\u4e60\u548c\u5de9\u56fa\uff0c\u662f\u4e3a\u4e86\u66f4\u597d\u7684\u5c06\u5176\u8fd0\u7528\u5230\u9879\u76ee\u4e2d\uff0c\u6b22\u8fce\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u5e26\u4f60\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u77e5\u8bc6\u70b9\uff01 \u5982\u4f55\u89e3\u51b3\u7535\u8111\u65e0\u6cd5\u641c\u7d22\u5230\u84dd\u7259\u8bbe\u5907\u7684\u95ee\u9898<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-53358","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=53358"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53358\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=53358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=53358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=53358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}