I have seen an exact question being answered, but the problem is, I have absolutely no idea where to paste the codes shown here for mine to work. I am really a noob when it es to programming.
Would appreciate if someone would be so kind to enlighten me as I desperately need to get my calendar working. :(
Thank you so much.
I have seen an exact question being answered, but the problem is, I have absolutely no idea where to paste the codes shown here for mine to work. I am really a noob when it es to programming.
Would appreciate if someone would be so kind to enlighten me as I desperately need to get my calendar working. :(
Thank you so much.
Share Improve this question edited May 23, 2017 at 12:16 CommunityBot 11 silver badge asked Dec 30, 2010 at 9:06 Spiral1ngSpiral1ng 3231 gold badge8 silver badges16 bronze badges2 Answers
Reset to default 2var holidays= ["2014-7-30","2015-07-29","2013-03-16"]
$('input').datepicker({
beforeShowDay: function(date){
var string = jQuery.datepicker.formatDate('yy-mm-dd', date);
var noWeekend = $.datepicker.noWeekends(date);
if (noWeekend[0]) {
return [$.inArray(string, holidays) == -1];
}
else
return noWeekend;
}
});
I'll try to answer:
How to start you'll find - here
You will need theese: (link them in top of your page.)
- jQuery Library: Datepicker requires including jQuery.
- JavaScript: ui.core.js and ui.datepicker.js
- CSS Theme: Create your theme with ThemeRoller
You can find great demo about basis - here
<script>
$(function() {
/*function that makes appear datepicker + you add option to disable Weekends*/
$(".selector").datepicker({ beforeShowDay: $.datepicker.noWeekends })
});
</script>
<div id="demo">
<p>Date: <input class="selector" type="text"></p> //input field that calls the function
</div>
2 things to do:
- link jquery.js + ui.core.js and ui.datepicker.js + your css theme to your page
- paste this code into your webpage.
I can suggest you to do as i did - run threw a lot of tutorials, and most important thing to do - experiment!
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745383612a4625343.html
评论列表(0条)