Joomla! Discussion Forums



It is currently Wed Nov 25, 2009 1:01 pm (All times are UTC )

 


Forum rules

Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [SOLVED] Disable date
Posted: Wed Nov 04, 2009 6:50 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Wed Nov 04, 2009 6:45 pm
Posts: 2
Hello, could anyone post in this forum how to disable dates in the calendar.js from for example /includes/js/calendar/calendar.js I understand that this is case realted more to Script configuration but maybe you have example to show how to do it.

Actually I need the example on how to modify calendar.js file I don't want to insert <SCRIPT> into index.php head tag.

Thanks you in advance


Last edited by aivanov on Sun Nov 08, 2009 8:52 am, edited 1 time in total.

Top
  E-mail  
 
 Post subject: Re: Disable date
Posted: Sun Nov 08, 2009 8:52 am 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Wed Nov 04, 2009 6:45 pm
Posts: 2
Hello,

I finally managed to solve it by myself. I modified javascript of calendar which is locatedin /includes/js/calendar/calendar.js On this calendar all past days are disabled and today will be disabled if time is over 15:00.

I replaced code on line 37 this.getDateStatus = null;
with this one this.getDateStatus = getDateState;

And I inserted the code to the begining of the file:

Code:
/** The Calendar object constructor. */
function getDateState(date)
{
   var currentDate = new Date();
   if( date.getDate() == currentDate.getDate()  && date.getMonth() == currentDate.getMonth() && date.getFullYear() == currentDate.getFullYear() )
      if(currentDate.getHours() >= 15)
         return true;
      else return false;
   
   if( date.getTime() < currentDate.getTime() )
      return true;
   else return false;
}


I hope someone will find it usefull for his Virtuemart with Joomla or other cases


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

Quick reply

 



Who is online

Users browsing this forum: adehkordi, Alexa [Bot], Ask Jeeves [Bot], atoniolo, brett700, David112, drf, falieson, full_metal, ioanna, ooffick, Pastor Dan, trevorg15, Tuyuca and 122 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group