Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Nedeľa, 29. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  jsCalendar settings for disabling dates

phpMyEdit Configuration     jsCalendar settings for disabling dates
Odoslať novú tému   Odpovedať na tému    
 
Commsman     Založený: 29.05.2004   Príspevky: 7  
Príspevok Zaslal: 2011-07-22 15:39
Návrat hore  Odpovedať s citátom     

I am using the phpMyEdit-mce-cal extension to display calendar selection - everything seems easy enough to configure, except for disabling dates before today.
I believe I need to set my own disableDate handler function which returns false for those dates before today. The setup help says:

disableFunc | function that receives a JS Date object and should return true if that date has to be disabled in the calendar"

and the Calendar.setup function is currently set as the default:
param_default("disableFunc", null);
param_default("dateStatusFunc", params["disableFunc"]);

Does this mean that all I have to do is create a function called "disableFunc" which examines the date and returns true or false if it is to be disabled or not?

The jsCalendar example html file uses the following function to achieve this:

var MINUTE = 60 * 1000;
var HOUR = 60 * MINUTE;
var DAY = 24 * HOUR;
function isDisabled(date) {
var today = new Date();
return (Math.abs(date.getTime() - today.getTime()) / DAY) > 1;
}

So.. if I rename this function to "disableFunc" and place it inside the calendat-setup.js file, this should work - but it doesn't so I am doing something wrong (maybe a lot of things wrong!!?)

Should I set param_default("disableFunc" to true? - sorry - I am floundering around not really understanding what I am playing with here! I hope somebody can help.

Cheers
Julian

 
onglipo     Založený: 09.09.2011   Príspevky: 0  
Príspevok Zaslal: 2011-09-09 16:39
Návrat hore  Odpovedať s citátom     

Julian, Could you please give any pointers? Tried suggestions by zucarino http://opensource.platon.sk/forum/projects/viewtopic.php?t=1106
Thanks
=-oNg-=

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov