* IsSamemonth analog to IsSameDay. Mantis #19876

git-svn-id: trunk@18950 -
This commit is contained in:
marco 2011-09-02 19:44:54 +00:00
parent 3383db43cd
commit 0cc60e05f2

View File

@ -111,6 +111,7 @@ Function Yesterday: TDateTime;
Function Tomorrow: TDateTime;
Function IsToday(const AValue: TDateTime): Boolean;
Function IsSameDay(const AValue, ABasis: TDateTime): Boolean;
function IsSameMonth(const Avalue, ABasis: TDateTime): Boolean;
Function PreviousDayOfWeek (DayOfWeek : Word) : Word;
{ ---------------------------------------------------------------------
@ -618,6 +619,12 @@ begin
Result:=(D>=0) and (D<1);
end;
function IsSameMonth(const Avalue, ABasis: TDateTime): Boolean;
begin
result:=( YearOf(Avalue) = YearOf(Abasis) );
result:=result and ( MonthOf(AValue) = MonthOf(ABasis) );
end;
const
DOWMap: array [1..7] of Word = (7, 1, 2, 3, 4, 5, 6);