Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DateList function in the utility.prg for US date notati
Message
From
10/02/2003 23:30:08
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
 
To
09/02/2003 16:50:57
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00751213
Message ID:
00751762
Views:
16
Mark,

This could be fixed by using the DATE function with its optional parameters. For example...

lnYear = VAL(lcYear)
DO CASE
CASE lnMonth < 4
taDateArray[3, 1] = DATE(lnYear,1,1)
taDateArray[3, 2] = DATE(lnYear,3,31)

CASE lnMonth < 7
taDateArray[3, 1] = DATE(lnYear,4,1)
taDateArray[3, 2] = DATE(lnYear,6,30)

CASE lnMonth < 10
taDateArray[3, 1] = DATE(lnYear,7,1)
taDateArray[3, 2] = DATE(lnYear,9,30)

OTHERWISE
taDateArray[3, 1] = DATE(lnYear,10,1)
taDateArray[3, 2] = DATE(lnYear,12,31)
ENDCASE

HTH,
Larry Long

>
>The Current Quarter and current year cases from the DateList function in the utility.prg is made for US date notation.
>
>
*----------------------
>*--- Current Quarter
>*----------------------
>DO CASE
>	CASE lnMonth < 4
>		taDateArray[3, 1] = CTOD ("01/01/" + lcYear)
>		taDateArray[3, 2] = CTOD ("03/31/" + lcYear)
>			
>	CASE lnMonth < 7
>		taDateArray[3, 1] = CTOD ("04/01/" + lcYear)
>		taDateArray[3, 2] = CTOD ("06/30/" + lcYear)
>		
>	CASE lnMonth < 10
>		taDateArray[3, 1] = CTOD ("07/01/" + lcYear)
>		taDateArray[3, 2] = CTOD ("09/30/" + lcYear)
>			
>	OTHERWISE
>		taDateArray[3, 1] = CTOD ("10/01/" + lcYear)
>		taDateArray[3, 2] = CTOD ("12/31/" + lcYear)
>ENDCASE
>
>*-------------------
>*--- Current year
>*-------------------
>taDateArray[4, 1] = CTOD ("01/01/" + lcYear)
>taDateArray[4, 2] = CTOD ("12/31/" + lcYear)
>
>
>Thus, all controls that call this function, e.g. the cdatelistcombol, get into trouble for European date representation.
>
>Up till now, I have resolved this by subclassing the cdatelistcombolistl, copied the init method and inserted:
>
>
LOCAL cSetDate
>
>...
>
>cSetDate = SET("DATE")
>SET DATE AMERICAN
>
>*--------------------------------------------------
>*--- Get all from/to dates based on today's date
>*--------------------------------------------------
>=DateList(DATE(), @laDateList, This.nFirstDOW, This.nLastDOW)
>
>SET DATE (cSETDATE)
>
>Although this works, it think it would be better to change the utility.prg unless someone has got a better idea.
>
>
>Mark
L.A.Long
ProgRes
lalong1@charter.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform