Hi Danielo,

I took a look at the code on your tiddlyspot page. Looks like a pretty 
elaborate tiddlywik table generator.

The problem is happening only for June because June 1st (2014) happens to 
be on Sunday, and so it doesn't need any empty / leading cells in the 
calendar.

If you look at the console log output, you'll see that the table format for 
June is getting thrown off by a misplaced "|".

|! June 2014|>|>|>|>|>|>|>|
|! Sun|! Mon|! Tue|! Wed|! Thu|! Fri|! Sat|
*|*


You can add an if statement to handle the corner case and prevent the table 
from getting screwed up for any month where the 1st is on a Sunday. 

Try changing from this:

    cal += lf;
    cal += col;
 
    // fill in the blank gaps until today's day day of the week. This is 
the first day of this month
    for(var index=0; index < Calendar.getDay(); index++)
        cal += '  ' + col;

To this:

    // Only need a "special" first row with leading empty cells if the 1st 
of the month is *not* on Sunday.
    if (Calendar.getDay() > 0) {
        cal+= lf;
        cal+= col;
    }

    //fill in the blank gaps until today's day day of the week. This is the 
first day of this month
    for(var index=0; index < Calendar.getDay(); index++)
        cal+= '  ' + col;

I tested the change out and it fixes the table / calendar for June.

On Friday, January 31, 2014 1:04:32 AM UTC-5, Danielo Rodríguez wrote:
>
> Hello
>
> I'm triying to do some kind of journal. So I wrote a macro that displays 
> every month as a table. I don't understand why every month is displayed 
> correctly except for June. In fact, June is only displayed incorrectly if 
> it has other month immediately above. If it is the first or stand alone, it 
> is displayed properly.
>
> If you want to check the code enter to  http://braintest.tiddlyspot.com/and 
> look for TestMonth.
> Thanks in advance.
> Kind regards.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to