Welcome Guest, Not a member yet? Register   Sign In
Full Year Layout Using Calendar Class
#1

[eluser]herbageonion[/eluser]
Hi, I was just wondering if its possible to use the Calendar class in CI to create a full year calendar with each month laid out on the same canvas with previous year and next year links at the top.

Something like this:
Code:
<< Prev Year                                 2007                                  Next Year >>

January                  February                 March                    April
Mo Tu We Th Fr Sa Su     Mo Tu We Th Fr Sa Su     Mo Tu We Th Fr Sa Su     Mo Tu We Th Fr Sa Su
   1  2  3  4  5  6                  1  2  3                  1  2  3      1  2  3  4  5 6  7
7  8  9  10 11 12 13     4  5  6  7  8  9  10     4  5  6  7  8  9  10     8  9  10 11 12 13 14
14 15 16 17 18 19 20     11 12 13 14 15 16 17     11 12 13 14 15 16 17     15 16 17 18 19 20 21
21 22 23 24 25 26 27     18 19 20 21 22 23 24     18 19 20 21 22 23 24     22 23 24 25 26 27 28
28 29 30 31              25 26 27 28              25 26 27 28 29 30 31     29 30


May                      June                     July                     August
Mo Tu We Th Fr Sa Su     Mo Tu We Th Fr Sa Su     Mo Tu We Th Fr Sa Su     Mo Tu We Th Fr Sa Su
      1  2  3  4  5                  1  2  3      1  2  3  4  5  6  7            1  2  3  4  5
6  7  8  9  10 11 12     4  5  6  7  8  9  10     8  9  10 11 12 13 14     6  7  8  9  10 13 14
13 14 15 16 17 18 19     11 12 13 14 15 16 17     15 16 17 18 19 20 21     11 12 13 14 15 16 17
20 21 22 23 24 25 26     18 19 20 21 22 23 24     22 23 24 25 26 27 28     18 19 20 21 22 23 24
27 28 29 30              25 26 27 28 29 30 31     29 30                    25 26 27 28 29 30 31


September                October                  November                 December
Mo Tu We Th Fr Sa Su     Mo Tu We Th Fr Sa Su     Mo Tu We Th Fr Sa Su     Mo Tu We Th Fr Sa Su
1  2  3  4  5  6  7            1  2  3  4  5                     1  2      1  2  3  4  5  6  7
8  9  10 11 12 13 14     6  7  8  9  10 11 12     3  4  5  6  7  8  9      8  9  10 11 12 13 14
15 16 17 18 19 20 21     13 14 15 16 17 18 19     10 11 12 13 14 15 16     15 16 17 18 19 20 21
22 23 24 25 26 27 28     20 21 22 23 24 25 26     17 18 19 20 21 22 23     22 23 24 25 26 27 28
29 30                    27 28 29 30 31           24 25 26 27 28 29 30     27 28 29 30 31
#2

[eluser]sophistry[/eluser]
it should be possible using multiple calls to the calendar class to generate each month, but you may have to do some extra work around the calendar class to get year "paging."

cheers.
#3

[eluser]herbageonion[/eluser]
Sorry, forgot to come back to this. ztar provided a nice little loop for this, found here for anyone who runs in to this in the future.




Theme © iAndrew 2016 - Forum software by © MyBB