I would like to have a calendar which has stlyes for every blank day, as opposed to what is supported by current Drupal HEAD. It should look something like:

Drupal calendar suggestion

I see that it would only be possible if we make the blank days themeable. It would be possible to make the whole calendar themeable, but that would open up a lot more stuff, since then the calendar code would need to be abstracted out from the archive table assembler code.

BTW this is a Hungarian Drupal setup, with monday being the first day, and the calendar is for 2005 January.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

Here is a proposed patch, which simply makes the blank days themeable, so that I can use str_repeat("<td class=\"day-blank\">&nbsp;</td>\n", $blankdays) in my theme.

Gábor Hojtsy’s picture

What is this patch is waiting for? :)

Steven’s picture

I'm leaning towards making the whole calendar themable rather than just the blank days. It seems a bit too shallow. Another thing to consider is to simply output the blank days as individual cells, and use CSS to hide their border in the default themes (it uses border-collapse: collapse; so I think it wouldn't require special handling of the first/last blank cell).

Gábor Hojtsy’s picture

Good to get input on this :) Either way is fine with me, but making the whole calendar themeable is a lot more work in the code, since now logic and display are very much intermixed in the calendar code. It would be nice, if the CSS solution would work.

Gábor Hojtsy’s picture

As Steven suggested, here is a version, which always prints out individual table cells for blank days, so it is possible to style them differently in CSS, but retains the well-known calendar format with dropping the borders on the blank days, and falling back on border-collapsing (this is why the table border needs to be introduced).

Also included in this patch are some simple CSS optimizations to use 0 instead of 0em and 0px.

Dries’s picture

Committed to HEAD.

Anonymous’s picture