In some countries date format is different than US-standard. SimpleAds converts activation/deactivation dates to my national format (polish) while saving to database. Unfortunatelly function _simpleads_activate_deactive_ad (it is run by cron, it activates/deactivates ads due to these dates) does not convert it back, so it strtotime returns 0 for all dates. It causes that activation/deactivation does not work. My workaround for it is replacing:

if ($start_time != 0) {
      $node->field_ad_start_date[$node->language][0]['value'] = format_date($start_time, 'custom', 'm/d/Y h:i a');
    }
    if ($end_time != 0) {
      $node->field_ad_end_date[$node->language][0]['value'] = format_date($end_time, 'custom', 'm/d/Y h:i a');
    }

with

if ($start_time != 0) {
      $node->field_ad_start_date[$node->language][0]['value'] = format_date($start_time, 'custom', 'm/d/Y h:i a', 'Europe/Warsaw', 'en');
    }
    if ($end_time != 0) {
      $node->field_ad_end_date[$node->language][0]['value'] = format_date($end_time, 'custom', 'm/d/Y h:i a', 'Europe/Warsaw', 'en');
    }

in simpleads_node_presave function (simpleads.module file). Users must use US date format but it works.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

balis_m’s picture

I had the same issue.

So, i made this patch to fix it.

minnur’s picture

Status: Active » Closed (won't fix)