Activation/deactivation dates in non-english websites

Created on 20 March 2013, over 11 years ago
Updated 9 June 2023, about 1 year ago

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.

πŸ› Bug report
Status

Closed: won't fix

Version

1.8

Component

Code

Created by

πŸ‡΅πŸ‡±Poland jjzz12

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024