[Profile Register/Log In] (What's This?)

Re: beatitude scheduled time problems

From: Mariano Absatz - gmail <el.baby@gmail.com>
Subject: Re: beatitude scheduled time problems
In-Reply-To: Re: beatitude scheduled time problems
Date: July 12th 2012

For me, having a 24 hour clock would be great. Argentina (and a lot of other countries) is used to a 24 hour clock (and most of the people have a hard time guessing if 12:00AM is either noon or midnight) :)

On Mon, Mar 12, 2012 at 9:10 PM, Justin J <justin@dadamailproject.com> wrote:

On Mar 12, 2012, at 5:15 PM, Justin J wrote:
> Anyways, I can recreate your problem - it probably has to do with this method in dada/DADA/MailingList/Schedules.pm. It turns the data you set in the form into something that time() would return:


I can't full explain it, but if I change this one line:

   my $hour       = $q->param('mail_hour')   || 0;

to,

   my $hour       = $q->param('mail_hour')   || 12;

that mysterious (gained an hour) problem goes away.

The underlying problem is probably that I'm trying to work with 12 hour clock, instead of a 24 hour clock and that makes things very much convoluted.

--

Justin J: Lead Dadaist.
url:      http://dadamailproject.com
email:    justin@dadamailproject.com

On Mar 12, 2012, at 5:15 PM, Justin J wrote:

>
>
> On Mar 12, 2012, at 5:32 AM, Mariano Absatz - gmail wrote:
>> I also have my crontab file with environment variables to that effect and, other than the bug described, the site AND crontab do work OK with Buenos Aires' times.
>
> Hmm, I didn't know you could set environmental variables in a cronjob (except for, MAILTO, which I'm not sure is really a env var) - I'm still not quite sure, but it's not going to set for the cronjob for Beatitude, since the cronjob will just start an HTTP process, which will have its own environment.
>
>
> Anyways, I can recreate your problem - it probably has to do with this method in dada/DADA/MailingList/Schedules.pm. It turns the data you set in the form into something that time() would return:
>
>
>
> sub mailing_date {
>
>       my $self = shift;
>       my $q    = shift;
>
>    my $min        = $q->param('mail_minute') || 0;
>    my $hour       = $q->param('mail_hour')   || 0;
>    my $mday       = $q->param('mail_day')    || 1;
>    my $mon        = $q->param('mail_month')  || 0;
>    my $year       = $q->param('mail_year')   || 0;
>    my $mail_am_pm = $q->param('mail_am_pm')  || 'am';
>
>    # This is a little hacky...
>    if ( $mail_am_pm eq 'pm' ) {
>
>        # But - if the hour is, "12"
>        # 12 + 12 is, "24" - not, "0' and not just, "12"
>        if ( $hour != 12 ) {
>            $hour += 12;
>        }
>    }
>    elsif ( $mail_am_pm eq 'am' ) {
>        if ( $hour == 12 ) {
>            $hour = 0;
>        }
>    }
>
>    $min = int($min);
>    require Time::Local;
>    my $time = Time::Local::timelocal( 0, $min, $hour, $mday, $mon, $year );
>    return $time;
>
> }
>
>
> I bet the bug is in the, "am" and "pm" check. Working with a 24 hour clock would be a ton simpler,
>
>
>
>
> --
>
> Justin J: Lead Dadaist.
> url:      http://dadamailproject.com
> email:    justin@dadamailproject.com
>
> On Mar 12, 2012, at 5:32 AM, Mariano Absatz - gmail wrote:
>
>> I don't think so...
>>
>> Where I live DST has not been applied for some time. The site, however, is shared hosted in DreamHost and I think they use Pacific Time and adjust DST correspondingly.
>>
>> However, I have a .htaccess file in my dada cgi folder with a line to configure the timezone as my home zone like this:
>>
>> SetEnv TZ America/Argentina/Buenos_Aires
>>
>> I also have my crontab file with environment variables to that effect and, other than the bug described, the site AND crontab do work OK with Buenos Aires' times.
>>
>> This is my crontab:
>>
>> MAILTO=el.baby@gmail.com
>> TZ="America/Buenos_Aires"
>> LANG="en_US.UTF-8"
>> LANGUAGE="en_AR:en_US:en_GB:en"
>> LC_TIME="en_GB.UTF-8"
>>
>> # m                     h               d               m               w               command
>>
>> # auto pickup mailing list (cada 5 minutos)
>> #3-59/5         *               *               *               *               /usr/bin/curl -s --get --data verbose=0 --url http://mailing.juanabsatz.com/admin/dada/extensions/auto_pickup.pl
>> # mailing monitor (cada 5 minutos)
>> 3-59/5          *               *               *               *               /usr/bin/curl -s --get --data run=1\;passcode=\;verbose=0 --url http://mailing.juanabsatz.com/admin/dada/plugins/mailing_monitor.cgi
>> # scheduled mailing (cada 10 minutos)
>> 0-59/10         *               *               *               *               /usr/bin/curl -s --get --data run=1\;passcode=\;verbose=0 --url http://mailing.juanabsatz.com/admin/dada/plugins/scheduled_mailings.pl
>>
>> # vim: ts=4
>>
>>
>>
>>
>>
>>
>>
>> On Mon, Mar 12, 2012 at 04:00, Justin J <justin@dadamailproject.com> wrote:
>>
>> Randomly, does this have anything to do with Daylight Savings?
>>
>> On Mar 10, 2012, at 12:19 PM, Mariano Absatz - gmail wrote:
>>> I go to Beatitude's schedule list and I see the new entry like: "Sun Mar 11 00:00:00 2012", OK.
>>>
>>> However, if I click on it to edit the entry, the schedule now says: "March - 11th - 2012 - 1 : 00 - AM" (that is, Beatitude probably thought I might prefer the message to be sent at 1:00 AM rather than midnight). If I don't save the schedule, it stays as I wrote it (midnight). However, if I change anything (not touching the time schedule), and save the entry, it now says: "Sun Mar 11 01:00:00 2012", not what I intended.
>>
>>
>> --
>>
>> Justin J: Lead Dadaist.
>> url:      http://dadamailproject.com
>> email:    justin@dadamailproject.com
>>
>> On Mar 10, 2012, at 12:19 PM, Mariano Absatz - gmail wrote:
>>
>>> Hi Justin,
>>>
>>> I just upgraded my pro dada from 4.5.2 to 4.9.1 and it was a snap. I only had to fiddle with a couple of changes I had manually made to some of the source files.
>>>
>>> Anyway, this is not what I'm here for... I noticed a problem with the scheduled times in beatitude (and it's been here at least from 4.3.0, when I started using beatitude).
>>>
>>> I think that when you edit an existing schedule under certain scheduled time conditions, Beatitude changes the scheduled time by itself. If you make some changes (not involving the scheduled time) and save them, the scheduled time will change to what Beatitude put there.
>>>
>>> It may be an excess on Beatitude's personality... maybe it's good to have software with a personality, but, nonetheless, it is an annoyance (well, most of my friends also have annoyances, and that's part of THEIR personality, right?) :-)
>>>
>>> To the point:
>>>
>>> CASE 1 - MIDNIGHT SCHEDULE
>>>
>>> I create a new entry in Beatitude and schedule it to start on midnight between Saturday March 10th and Sunday March 11th (so, the schedule says: "March - 11th - 2012 - 12 : 00 - AM").
>>>
>>> BTW, I'd LOVE to be able to use a 24h clock setting for this.
>>>
>>> I go to Beatitude's schedule list and I see the new entry like: "Sun Mar 11 00:00:00 2012", OK.
>>>
>>> However, if I click on it to edit the entry, the schedule now says: "March - 11th - 2012 - 1 : 00 - AM" (that is, Beatitude probably thought I might prefer the message to be sent at 1:00 AM rather than midnight). If I don't save the schedule, it stays as I wrote it (midnight). However, if I change anything (not touching the time schedule), and save the entry, it now says: "Sun Mar 11 01:00:00 2012", not what I intended.
>>>
>>> CASE 2 - ONE MINUTE TO MIDNIGHT SCHEDULE
>>>
>>> I create a new entry in Beatitude and schedule it to start one minute before midnight between Saturday March 10th and Sunday March 11th (so, the schedule says: "March - 10th - 2012 - 11 : 59 - PM").
>>>
>>> I go to Beatitude's schedule list and I see the new entry like: "Sat Mar 10 23:59:00 2012", OK.
>>>
>>> However, if I click on it to edit the entry, the schedule now says: "March - 10th - 2012 - 11 : 59 - AM" (that is, Beatitude probably thought I might prefer the message to be sent one minute before noon rather than midnight). If I don't save the schedule, it stays as I wrote it (midnight). However, if I change anything (not touching the time schedule), and save the entry, it now says: "Sun Mar 10 11:59:00 2012", not what I intended.
>>>
>>>
>>>
>>> FWIW, I noticed case 1 long ago (using 4.3.0 and 4.5.2); case 2 I just tested today with 4.9.1.
>>>
>>> Regards.
>>> --
>>> Mariano Absatz - El Baby
>>> www.clueless.com.ar
>>>
>>>
>>> Post:
>>> mailto:dadadev@dadamailproject.com
>>>
>>> Unsubscribe:
>>> http://dadamailproject.com/cgi-bin/dada/mail.cgi/list/dadadev
>>>
>>> Archive:
>>> http://dadamailproject.com/cgi-bin/dada/mail.cgi/archive/dadadev
>>>
>>> Developer Info:
>>> http://dev.dadamailproject.com
>>>
>>> Mailing List Powered by Dada Mail
>>>
>>
>>
>>
>> --
>>
>> * Post:
>> mailto:dadadev@dadamailproject.com
>>
>> * Unsubscribe:
>> http://dadamailproject.com/cgi-bin/dada/mail.cgi/u/dadadev
>>
>> * List Information:
>> http://dadamailproject.com/cgi-bin/dada/mail.cgi/list/dadadev/
>>
>> * Archive:
>> http://dadamailproject.com/cgi-bin/dada/mail.cgi/archive/dadadev
>>
>> Developer Info:
>> http://dev.dadamailproject.com
>>
>> Mailing List Powered by Dada Mail
>> http://dadamailproject.com/cgi-bin/dada/mail.cgi/what_is_dada_mail/
>>
>>
>>
>> --
>> Mariano Absatz - El Baby
>> www.clueless.com.ar
>>
>>
>> Post:
>> mailto:dadadev@dadamailproject.com
>>
>> Unsubscribe:
>> http://dadamailproject.com/cgi-bin/dada/mail.cgi/list/dadadev
>>
>> Archive:
>> http://dadamailproject.com/cgi-bin/dada/mail.cgi/archive/dadadev
>>
>> Developer Info:
>> http://dev.dadamailproject.com
>>
>> Mailing List Powered by Dada Mail
>>
>
>
>
> --
>
> * Post:
> mailto:dadadev@dadamailproject.com
>
> * Unsubscribe:
> http://dadamailproject.com/cgi-bin/dada/mail.cgi/u/dadadev
>
> * List Information:
> http://dadamailproject.com/cgi-bin/dada/mail.cgi/list/dadadev/
>
> * Archive:
> http://dadamailproject.com/cgi-bin/dada/mail.cgi/archive/dadadev
>
> Developer Info:
> http://dev.dadamailproject.com
>
> Mailing List Powered by Dada Mail
> http://dadamailproject.com/cgi-bin/dada/mail.cgi/what_is_dada_mail/



--

* Post:
mailto:dadadev@dadamailproject.com

* Unsubscribe:
http://dadamailproject.com/cgi-bin/dada/mail.cgi/u/dadadev

* List Information:
http://dadamailproject.com/cgi-bin/dada/mail.cgi/list/dadadev/

* Archive:
http://dadamailproject.com/cgi-bin/dada/mail.cgi/archive/dadadev

Developer Info:
http://dev.dadamailproject.com

Mailing List Powered by Dada Mail
http://dadamailproject.com/cgi-bin/dada/mail.cgi/what_is_dada_mail/



--
Mariano Absatz - El Baby
www.clueless.com.ar




<< Previous: Will be back on the 6th

| Archive Index |

Next: auto-responder >>

(archive rss , atom rss/atom )

this list's archives:


This mailing list is to discuss the nerdy programming development of Dada Mail -

If you are just looking for support Dada Mail, consult the message boards at:

http://dadamailproject.com/support/boards

To post to this list, send a message to:

dadadev@dadamailproject.com

All subscribers of this list may post to the list itself.

Some on topic... topics include:

  • Positive Crits on the program (I like, "x", but, "y" needs some work - here's an idea on how to make this better...)
  • Bug/Error reports
  • Bug fixes
  • Request For Comments on any changes to the program
  • Help customizing Dada Mail for your own internal needs
  • Patches
  • Language Translations
  • Support Documentation/Doc editing, FAQ's, etc.
  • Discussion of any changes that you would like to be committed to the next version of Dada Mail -

At the moment, there aren't many people with CVS access for Dada Mail - if you would like CVS access, please first talk about the changes you propose and how it will affect the program. If the idea is sound and agreed upon, the change will be comitted. A good track record of this will allow you to have CVS access. Some reasons that patches will not be accepted is if the patch breaks compatibility with a previous version of the program, the patch is too centric to your own problem or the patch simply isn't very good.

Please, please please familiarize yourself with the documentation at:

http://dadamailproject.com/support/documentation/

Since no one wants to answer the same question twice.

Another sneaky reason for this mailing list is to test out the discussion list capabilities of Dada Mail, since Dada Mail is used for the mailing list itself.

NOTE - because of this, there may be times that this list will be somewhat broken. Although we're not planning on breaking the program by using it, we're giving you the heads up that this may well happen anyways.

Subscribe to Dada Mail Developers

* Required

Loading