Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | dates_in_non_english_websites-1947646-1.patch | 884 bytes | balis_m |
Comments
Comment #1
balis_m CreditAttribution: balis_m commentedI had the same issue.
So, i made this patch to fix it.
Comment #2
minnur CreditAttribution: minnur as a volunteer commented