Help with parseDate utility...
Hi,
I'm fairly new to using jQuery. I'm trying to omit dates from a datepicker calendar.
I want to omit dates by using 3 separate formats:
(1) day of the week
(2) specific date
(3) date range
Each format above can have multiple instances, for instance, I can have all Tuesdays and Wednesdays blocked off along with a specific date and a few date ranges.
- $(function() {
- $("#datepicker").datepicker({
- dateFormat: 'yy-mm-dd',
- numberOfMonths: 3,
- showOtherMonths: false,
- changeMonth: false,
- changeYear: false,
- minDate: 0,
- maxDate: '+12M',
- selectOtherMonths: false,
- // beforeShowDay: $.datepicker.noWeekends,
- onDate: $.datepicker.parseDate('yy-mm-dd', '2010-10-10')
- });
-
- });
This is what I have right now, but I want to implement PHP code
so I was thinking more in the lines of this:
- $(function() {
- $("#datepicker").datepicker({
- dateFormat: 'yy-mm-dd',
- numberOfMonths: 3,
- showOtherMonths: false,
- changeMonth: false,
- changeYear: false,
- minDate: 0,
- maxDate: '+12M',
- selectOtherMonths: false,
- // To omit specific dates
- <?
- $query = "SELECT * FROM exemptdates WHERE type = 'day';
- while ($exemptdates = mysql_fetch_array($result(mysql_query($query))) {
- ?>
- $.datepicker.parseDate('yy-mm-dd', '<?=$exemptdates[date];?>')
- <?
- }
- ?>
- });
- });
The same would apply for specific days and date ranges.
Thanks in advance!