I need to get a series of dates from a mysql database using php, once I query the database and have all my dates as a result of the query, is it then possible to show those dates in for example red on the jquery UI calendar?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here is some code that should help you.
Here’s a link to a working version: http://jsfiddle.net/tiborkiray/EXGW4/
CSS:
JavaScript:
The function beforeShowDay takes a date as a parameter and must return an array with [0] equal to true/false indicating whether or not this date is selectable, [1] equal to a CSS class name(s) or “” for the default presentation, and [2] an optional popup tooltip for this date. It is called for each day in the datepicker before it is displayed.
You should make the dates from server side (MySql) available on the client side. Once you have those dates add them to the beforeShowDay logic. In javascript new Date(unix_timestamp*1000); will convert your server side timestamp into one that javascript can consume (1000 is to go from seconds to miliseconds)