mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 10:39:40 +01:00 
			
		
		
		
	+ Fixed DecodeDayOfWeekInMonth
This commit is contained in:
		
							parent
							
								
									d5a2c2e068
								
							
						
					
					
						commit
						81ed80915f
					
				@ -1848,17 +1848,28 @@ begin
 | 
				
			|||||||
end;
 | 
					end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Function InternalNthDayOfWeek(DoM : Word) : Word;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					begin
 | 
				
			||||||
 | 
					  Result:=(Dom-1) div 7 +1;
 | 
				
			||||||
 | 
					end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Function NthDayOfWeek(const AValue: TDateTime): Word;
 | 
					Function NthDayOfWeek(const AValue: TDateTime): Word;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
begin
 | 
					begin
 | 
				
			||||||
  Result:=(DayOfTheMonth(AValue)-1) div 7 + 1;
 | 
					  Result:=InternalNthDayOfWeek(DayOfTheMonth(AValue));
 | 
				
			||||||
end;
 | 
					end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Procedure DecodeDayOfWeekInMonth(const AValue: TDateTime; var AYear, AMonth, ANthDayOfWeek, ADayOfWeek: Word);
 | 
					Procedure DecodeDayOfWeekInMonth(const AValue: TDateTime; var AYear, AMonth, ANthDayOfWeek, ADayOfWeek: Word);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var
 | 
				
			||||||
 | 
					  D: Word;
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
begin
 | 
					begin
 | 
				
			||||||
  NotYetImplemented('DecodeDayOfWeekInMonth');
 | 
					  DecodeDate(AValue,AYear,AMonth,D);
 | 
				
			||||||
 | 
					  ADayOfWeek:=DayOfTheWeek(AValue);
 | 
				
			||||||
 | 
					  ANthDayOfWeek:=InternalNthDayOfWeek(D);
 | 
				
			||||||
end;
 | 
					end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -2011,7 +2022,10 @@ end.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  $Log$
 | 
					  $Log$
 | 
				
			||||||
  Revision 1.9  2004-12-30 11:57:25  michael
 | 
					  Revision 1.10  2004-12-30 13:06:53  michael
 | 
				
			||||||
 | 
					  + Fixed DecodeDayOfWeekInMonth
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Revision 1.9  2004/12/30 11:57:25  michael
 | 
				
			||||||
  + Fixed tryencodedatemonthweek, fixed recodedatetime milliseconds
 | 
					  + Fixed tryencodedatemonthweek, fixed recodedatetime milliseconds
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Revision 1.8  2004/12/29 18:31:04  michael
 | 
					  Revision 1.8  2004/12/29 18:31:04  michael
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user