You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by John Morrison <jo...@experian.com> on 2000/09/05 17:33:37 UTC

Update/sample for calendar...

Hi,

Fixed a bug where there could be 5 weeks in a month if the first day
was a Sunday and added week_of_year and day_of_year.  Also, since I
think that all things really should have a sample (esp something this easy)
I've knocked together a page which will display a years calendar from
the current month.

I quite like tinkering so I'll try and add more functionality (moon phases
anybody?) when I can!

Enjoy,

John.

begin 644 cal.zip
M4$L#!!0``@`(`&)[)2E6GO7N?@@``$P9```0````6%-00V%L96YD87(N:F%V
M8:U8VW+;1A)]9JKR#[UX2$@9!D4YV8LEN@R1D(1=WA8`I>A)`8&AB!C$L`:@
M:&8K_[[=,P`(WB2K9%59`F=Z3I\^?1G0S9.3'W^`]G?\0;C]'V_&P%SX`?YQ
M^31;^8)!+PI8DC(=;IE((YY`RVA]=RX(V.&+M8@>9QG4.PWXO&:^^'R0T!5?
M)J&?(14#S#@&>2@%P5(FGEAH2#2'A5&:B6BR)$/PDQ"6*8,H@90O1<#DRB1*
M?+&&*1?S5(=5E,V`"_F7+S.8\S":1H'_'N$(1`?ROF!B'F49"V$A^%,4XD,V
M\S/\Q1`HCODJ2AXAX$D8T:%4'IJS[*.DU3)VF*7`IU!P"GB(MLLT`XPF\Y$L
MH?H3_D1[A3R0\`QSHJL,9K,HA1@1":CJ-@EW.*';(/:C.1-*HK-]+NBQHHFB
M(A@&&BZ1WB$R;^8">90A#Y9SEF0RL0H.CS4Q'QRW!<S]C(G(C].-[C)A\FPE
M"!7;!T.6#DO"]YAVL8V.+H-XN84@MH30(9JB][4N%5!D\C.P$PCXP9>$KV(6
M/A+^1P#-(Q649EEQ+*4<J_I5<"%[8C%?(`>8K"7F,W4.4)]EV>)CL[E:K0Q?
MVAE</#8;AJ;@S!C525"B&$G+-.P00_W6N+988%L5DA>,(,I2%D]U#'):*@\K
M5!U)"DB7`8D4B?#]PA?9>@<YQ1H0<S^.USF\RL`O*@.)/\?@M0X/.$\T"0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W6FG[90`ZZU0'"8R)DN&1-?QWX^RK<3=G':[!-+3(_GXR#A].)6:/8/S
MA35KOIC?\X?L]N;V)CUYO?+8:O`*`!G1C%\1N.8*L5H)T33-O/DXM^XH%LOE
M4CQNOHNMD\8?K"OY)0E"66F)P$J)N5KSW!H$@X&1=(3*V1R\+\QQ5AB/KLZ1
MQ#`C2PCLW%HS"SDEQ6!;$8AP0J&PU#P5US-0`<98J!*HH1Q=6;JS^S9<DB1%
MN=/0G^GBLA3WV?MWBT_W7U)!Q_XA">BF-GO9_HG^L%/HM@8_`?^$O9E\V*K:
M3>'?7#&!;B36+N+TXZ+^8(2L*MW.HN.>>="0XYJ7Y+GB8FA;G/ON#!'1D50,
M1O6NQC371]FG[4(']SK:L]0US.SA7/YKF"65'Y*<,&.Q!)VOQ+0@78B)_5-Z
MEEOM*TF+^IF/!Q5M>-6#!N!79\&_=M<%C)IC4A='JNV*HZ)5O"([1#W9P]-?
M\E_31O/LN>X_](6@7MY96DY_+'#\4C!7UOIAQ3N@46`8E>ZF4I>[R!Z>)T;7
MD\28U8_P[NT9DL2Q%V?ZAU'HL)-1W$BK106N*:+^I)_XB/^2T&.7C@?KI^P4
M+[]NV6]02P$"%``4``(`"``H>24IH:C)W:\!``!_`P``#``````````!`"``
MMH$`````8V%L96YD87(N>&UL4$L!`A0`%``"``@`SGLE*5XD%O;;`0``!P4`
M`!$``````````0`B`+:!V0$``&-A;&5N9&%R+FAT;6PN>'-L4$L%!@`````"
-``(`>0```.,#`````"FA
`
end

Re: Update/sample for calendar...

Posted by Donald Ball <ba...@webslingerZ.com>.
On Tue, 5 Sep 2000, John Morrison wrote:

> Hi,
> 
> Fixed a bug where there could be 5 weeks in a month if the first day
> was a Sunday and added week_of_year and day_of_year.  Also, since I
> think that all things really should have a sample (esp something this easy)
> I've knocked together a page which will display a years calendar from
> the current month.
> 
> I quite like tinkering so I'll try and add more functionality (moon phases
> anybody?) when I can!

word. patches have been applied. would you mind passing along your sample
page as well (wasn't in the zip)? thanks.

btw, i think there's a definite need for a generic calendar xsp logicsheet
- which the current calendar is not, being strongly tied to a month
view. what i'd thought about was some function which took the following
inputs:

start date (e.g. 1/1/2000)
stop date (e.g. 1/31/2000)
shortest time unit (e.g. date)
list of time units to display (date, week_of_month, month, year)

which would iterate from the start date to the stop date incrementing by
the shortest time unit creating an XML structure as it went. i had real
trouble doing it in a strictly java library using DOM objects, but now
that i really understand how XSP logicsheets work (see esql logicsheet),
it might prove easier to write it. got any thoughts along these lines?

- donald