Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DateList function in the utility.prg for US date notation
Message
De
09/02/2003 16:50:57
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Titre:
DateList function in the utility.prg for US date notation
Divers
Thread ID:
00751213
Message ID:
00751213
Vues:
58
Hi,

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
If everything seems to be going well, you obviously don't know what the hell is going on !
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform