Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 563565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:40:26+00:00 2026-05-13T12:40:26+00:00

I’ve been trying to get my first module to work, but keep getting Fatal

  • 0

I’ve been trying to get my first module to work, but keep getting Fatal error: Call to undefined method JDocumentRendererModule::isTuesday() and can’t for the life of me figure out what is wrong.
I think I followed all tutorials to the letter, however as I am not really comfortable with PHP, I suspect the problem really lies between the chair and the keyboard in this case! 🙂

Joomla Version 1.5.15

PHP 5.2.11 / 5.3.1 for testing

Any help is really appreciated.

here is my code…

mod_jjoz_tourdates.php

<?php
 defined('_JEXEC') or die('Direct Access to this location is not allowed.');
// Include the syndicate functions only once
require_once( dirname(__FILE__).DS.'helper.php' );
$mdates = modJJOZtourdatesHelper::getDatesByMonth();
require( JModuleHelper::getLayoutPath( 'mod_jjoz_tourdates' ) );

helper.php

// no direct access
defined('_JEXEC') or die('Restricted access');

define('INTERNAL_FORMAT', 'Y-m-d');
define('DISPLAY_MONTH_FORMAT', 'M Y');
define('DISPLAY_DAY_FORMAT', 'D d M Y');

class modJJOZtourdatesHelper {


var $excluded_dates = array('2010-03-09','2010-04-13');

// operating days as per parameters
var $op_mon,$op_tue,$op_wed,$op_thu,$op_fri,$op_sat,$op_sun;


function getBlockeddatelist($params){
    $excluded_dates = array($params ->get('blockeddatelist'));
    return $exluded_dates;
}

  /*  date('w') returns a string numeral as follows:
   '0' Sunday
   '1' Monday
   '2' Tuesday
   '3' Wednesday
   '4' Thursday
   '5' Friday
   '6' Saturday
 */
function isSunday($date) {
    return date('w', strtotime($date)) === '0';
}

function isMonday($date) {
    return date('w', strtotime($date)) === '1';
}

  // why are you "undefined" ???
function isTuesday($date) {
    return date('w', strtotime($date)) === '2';
}

function isWednesday($date) {
    return date('w', strtotime($date)) === '3';
}

function isThursday($date) {
    return date('w', strtotime($date)) === '4';
}

function isFriday($date) {
    return date('w', strtotime($date)) === '5';
}

function isSaturday($date) {
    return date('w', strtotime($date)) === '6';
}

// handle the excluded dates
function isExcludedDate($internal_date) {
    return in_array($internal_date, $this->excluded_dates);
}


function getDatesByMonth()  {

    $start_date = date(INTERNAL_FORMAT);
    $months_and_dates = array();

    // loop over 365 days and look for tuesdays or wednesdays not in the excluded list
    foreach(range(0,365) as $day) {
        $internal_date = date(INTERNAL_FORMAT, strtotime("{$start_date} + {$day} days"));
        $this_day = date(DISPLAY_DAY_FORMAT, strtotime($internal_date));
        $this_month = date(DISPLAY_MONTH_FORMAT, strtotime($internal_date));

        if ($this->isTuesday($internal_date) || $this->isWednesday($internal_date) && !$this->isExcludedDate($internal_date)) {
            $months_and_dates[$this_month][] = $this_day;
        }
    }
    return $months_and_dates;
}
}

tmpl/default.php

<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>

<div>
 <?php
   // just loop and print the dates...
   foreach($mdates as $month => $days) {
       print $month . "<br>"."\n";
       print implode('<br>', $days);
       print "<br>"."\n";} 
 ?>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:40:26+00:00Added an answer on May 13, 2026 at 12:40 pm

    Just for the record and all those who stumble upon this thread.

    A friendly soul on a mailing list helped me out.

    The solution is:

    don’t use $this->isTuesday();
    use MyModuleHelper::isTuesday();

    therefore…

    if ($this->isTuesday($internal_date) || 
          $this->isWednesday($internal_date) && 
              !$this->isExcludedDate($internal_date)) {
                 $months_and_dates[$this_month][] = $this_day;}
    

    turns into

    if (modJJOZtourdatesHelper::isTuesday($internal_date) ||
          modJJOZtourdatesHelper::isWednesday($internal_date) && 
           !modJJOZtourdatesHelper::isExcludedDate($internal_date)) {
                $months_and_dates[$this_month][] = $this_day;}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 291k
  • Answers 291k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Thanks for the answers. I ended up removing the serialize()… May 13, 2026 at 5:55 pm
  • Editorial Team
    Editorial Team added an answer A reason for relying on the specific implementation of hashCode()… May 13, 2026 at 5:55 pm
  • Editorial Team
    Editorial Team added an answer For a small number of elements then a foreach loop… May 13, 2026 at 5:55 pm

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into
I have text I am displaying in SIlverlight that is coming from a CMS

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.