<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Datepicker - Default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script> $(function() { $( "#datepicker" ).datepicker(); }); </script> </head> <body> <p>Date: <input type="text" id="datepicker"></p> </body> </html>
$arr= "2014-03-14,2014-03-15,2014-03-16"; ?> <script type='text/javascript'> var array = '<?php echo $arr;?>'; alert(array); $('#start_date').datepicker({ beforeShowDay: function(date){ var string = jQuery.datepicker.formatDate('yy-mm-dd', date); return [ array.indexOf(string) == -1 ] } }); </script>
<?php $sql="select * from config_period where hotel_id='".$_REQUEST["hotel_id"]."' "; $query=mysql_query($sql); $arr=""; //while($result=mysql_fetch_array($query)){ date_default_timezone_set('America/Los_Angeles'); $strStartDate = "2014-10-01"; $strEndDate = "2014-10-31"; $intWorkDay = 0; $intHoliday = 0; $intTotalDay = ((strtotime($strEndDate) - strtotime($strStartDate))/ ( 60 * 60 * 24 )) + 1; while (strtotime($strStartDate) <= strtotime($strEndDate)) { $arr = $arr.$strStartDate.","; $strStartDate = date ("Y-m-d", strtotime("+1 day", strtotime($strStartDate))); } //} $arr = substr($arr,0,-1); ?> <script type='text/javascript'> var array = '<?php echo $arr;?>' $('#start_date').datepicker({ beforeShowDay: function(date){ var string = jQuery.datepicker.formatDate('yy-mm-dd', date); return [ array.indexOf(string) == -1 ] } }); </script>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง