Support from Acquia helps fund testing for Drupal Acquia logo

Comments

minnur’s picture

I will integrate Date module to SimpleAds module, but it's not going to be as a dependency. Meaning that you will have to install Date module before you install SimpleAds. Currently it's more easier to set Active/End dates by typing words "now" and expire, say "+1 week".

dgastudio’s picture

i'm agree with minnur. it's more easier manually set date.

but for datepicker integration, maybe it's better use http://jqueryui.com/demos/datepicker/#icon-trigger instead of Date module?

minnur’s picture

@xlyz, I haven't tried but I assume if you delete field_ad_start and filed_ad_end and recreate them as date fields, SimpleAds should still work.

minnur’s picture

Status: Active » Postponed
minnur’s picture

Status: Postponed » Closed (works as designed)
eidoscom’s picture

I can confirm that deleting and recreating the fields as Date data type is working well.

I think it will be fine to do this automatically if the user has the Date module activated at Simple Ad installation. The Date module is "standard" for drupal and gives you a lot of improvements than the simple textfield.

Anyway, thanks for the "God" module ;)

Dries Arnolds’s picture

Using the date module would also fix the time/date handling, which is now not localised. I have to use mm/dd/yyyy hh:mm am/pm while my local format is dd/mm/yyyy hh:mm (24hr format).

I like the idea of using "+4 months" though, so a choice is probably the best way to go.

minnur’s picture

Assigned: Unassigned » minnur
Status: Closed (works as designed) » Needs work

Currently I am working on a new version of Simpleads that uses Date field.

crystaldawn’s picture

Issue summary: View changes

What is the status of this? I'm really disappointed that "Text" was used for the datefield because I cant do something as simple as this:

//Get a list of all inactive ads older than 3 months
   $end_date = date('m/d/Y', time() - 7776000);
   $end_date = "2014-01-30 00:00:00";
   //dpm($end_date);
   $query = new EntityFieldQuery();
   $ads = $query->entityCondition('entity_type', 'node')
                ->propertyCondition('type', 'simpleads')
                ->propertyCondition('status', 0)
                ->fieldCondition('field_ad_end_date', 'value', $end_date, '<=')   //NOT POSSIBLE BECAUSE field_ad_end_date is a STRING?!@@#!!!!!  :`(   * CRY *
                ->execute();
   //dpm($ads);
tomrog’s picture

Here is another possible duplicate of this issue:
https://www.drupal.org/node/2539650

What's bugging me is when I want to use Views for showing active and current Simple Ads, it won't work. The problem is, if I have SimpleAd node, I can check "active" and set End date. But there is no use for setting the latter, cause I can't compare this field with "now" date in Views.

What's sad is that changing Text to Long Text field was achieveable, and changing date field to "normal" timestamp filed isn't :/

levmyshkin’s picture

After you replaced text fields with date fields, you need to remove changing date format in simpleads_node_presave():

minnur’s picture

Status: Needs work » Closed (won't fix)