Browse Source

* IsSamemonth analog to IsSameDay. Mantis #19876

git-svn-id: trunk@18950 -
marco 14 years ago
parent
commit
0cc60e05f2
1 changed files with 7 additions and 0 deletions
  1. 7 0
      rtl/objpas/dateutil.inc

+ 7 - 0
rtl/objpas/dateutil.inc

@@ -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);