• sherkaner

    (@sherkaner)


    You’re already doing it partially in the code (P, C and N), but I adapted it slightly like:

        $wn_sign = substr($parameters['weeknummer'], 0, 1);
        if(
          isset($parameters) &&
          array_key_exists('weeknummer', $parameters) &&
          ($parameters['weeknummer'] === 'P' || $parameters['weeknummer'] === 'C' || $parameters['weeknummer'] === 'N' || $wn_sign === '-' || $wn_sign === '+')
        ) {
          $adjustment = str_replace(array('C', 'P', 'N'), array('+0', '-7', '+7'), $parameters['weeknummer']);
          $wn = ltrim(date('W', strtotime($adjustment.' days', $timestamp)), '0');
          $extra = str_replace(array('weeknummer='.$parameters['weeknummer']),
                               array('weeknummer='.$wn),
                               $extra);
          $parameters['weeknummer'] = $wn;
        }

    So I can fill in ‘+14’ in a tag to get 2 weeks in advance. It would be better to make it ‘+2’, been lazy so far.

  • The topic ‘Add possibility to show x weeks in the future / past’ is closed to new replies.