Link to home
Start Free TrialLog in
Avatar of scrathcyboy
scrathcyboyFlag for United States of America

asked on

Vertical Calendar of mplungjan, part II

Having taken the standard flat horizontal calendar and reoriented it to vertical, in this question --

https://www.experts-exchange.com/questions/23115074/Reorient-calendar-to-vertical.html?anchorAnswerId=20757944#a20757944

I am asking mplungjan to continue and make the months and days automatically inserted into the calendar.  This can be done piece by piece.  There will be 4 x 7 days = 28 lines vertical, and 3 columns --

column 1 -- day abbreviations
column 2 -- first month -- always the current month, when the CAL is run -- like January, this month
Column 2 -- seconod month -- currently FEB, and will show the leftover days from Jan at the top.

The idea is whatever the date is, that month will show as the first month, and will start at day 1 of the first month.  Note, the Day abbreviations should be fixed and day 1 of the month could start down the list, it doesn't always have to move to the top.  Monday should stay at the top, like this --

           JAN            FEB

M                             28
T           1                 29
W          2                30
Th         3                31
F           4                 1
S           5                2
Su         6                3
M           7                4
T           8                 5

That is the correct layout for this and next month.  As long as the calendar "fills in" to the correct day positions for each month, currently for 2008, that is all that is needed for part II.  Thanks !!
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Ok, I am on it...

Apologies for the late comment - I am in CET...
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of scrathcyboy

ASKER

Fantastic job, Michel.  Yes I know it looks a bit weird, but the alternative may be worse. If you take 31 rows instead of 28, and iIf the 1st of month starts on a sunday, that is 6 days lost at the top, so the calendar dynamically has to grow and shrink from 28 lines to ass much as 31 + 6 + 2 header ~= 40 columns, too tall.  The only other way to do it, as I see it, would be to start the weekday at the top = 1st for each month.

I don't know how much more code it would be to start whichever day is the first of the month at the top, but it is something to think about.  Right now, you have answered what I asked with the above code exactly.  So I am closing the question and awarding points to a terrific solution.

See the code change below, I changed the CSS and the JS notice, please paste this into the top of your working code, for the next part of this project -- we are almost there, this may be the last part .....

https://www.experts-exchange.com/questions/23121081/Vertical-Calendar-Part-III-of-mplungjan.html
<style type="text/css">
<!--
 
.calmain {width:100px; border:0.5px solid silver;}
.month {background-color:#80B0E0; font:bold 10px Arial; color:white;}
.daysofweek {background-color:#F8F0F4; font:normal 10px Arial; color:#0000ff; padding: 1px;}
.days {font-size: 10px; font-family:Arial; color:black; background-color:#F8F4F0; padding: 0px;}
#today{font-weight:bold; color:red;}
 
-->
</style>
 
 
<script type="text/javascript">
/* Vertical Calendar copyright 2008 by Michel Plungjan - javascripts(a)plungjan.name */

Open in new window