Re: Pre-selected date
2008/08/01 00:29
Viewed 3209 times
Replies: 1/7

Try 'date' in Calendar.setup:

Calendar.setup({
displayArea : 'output-flat',
flat : 'calendar-container-flat',
multiple : MA,
flatCallback : myCallback,
date : '<?php echo date("Y/m/d H:i",$row['events_date']);?>', // Get date from db
});

/Barry

Re[2]: Pre-selected date
2008/08/09 18:57
Viewed 3453 times
Replies: 1/6

Cheers for replying Barry G.

I'd noticed the date parameter in the Calendar documentation but I didn't go down that path. It's great for pre-selecting one date but I want to be able to pre-select more than one date, if the event in question has more than one date. Any idea's on how to achieve this?
As a plan b I decided to implement the 'high-light special dates' feature which is within the calendar docs. At least this way I can high-light multiple dates but its not quite what I'm looking for as the dates aren't themselves selected, they just have a different css class making them appear a different colour.
Any idea's anyone?

Cheers all the same!

last
Re[3]: Pre-selected date
2008/08/19 19:14
Viewed 3534 times
Replies: 1/5

Try this...

<?php
$con=mysql_connect("localhost","<usr>","<pwd>");
mysql_select_db("<db>",$con);

$sql="SELECT * FROM <table>";
$result = mysql_query($sql);

$date = '[ ';
while($row = mysql_fetch_array($result)){
$date .= "new Date('".date("Y/m/d",$row['<timestamp field>'])."'), ";
}
$date .= ' ]';
//echo $date;
?>

Calendar code start...

<script type="text/javascript">//<![CDATA[
// the default multiple dates selected, first time the calendar is instantiated
// MA = [ new Date('2008/08/21'), new Date('2008/08/22'), new Date('2008/08/20'), ] ;
MA = <?php echo $date; ?>;

... calendar code continuing ...

/B

last
Google