View Issue Details

IDProjectCategoryView StatusLast Update
0004481JEDI VCL00 JVCL Componentspublic2008-09-24 14:44
Reporterlomo74Assigned Tojfudickar 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.34 
Target VersionFixed in Version 
Summary0004481: bug in JvTFUtils.IncMonths
DescriptionThe function JvTFUtils.IncMonths is buggy, it does not work on year boundaries.
Run attached project to reproduce the problem: the JvTFMonths component cannot go beyond november or before january.
Proposed solution:

procedure IncMonths(var ADate: TDateTime; N: Integer);
                                      // N defaults to 1
var
  Y, M, D, EOMD: Word;
  X: Cardinal; //This line added by me
begin
  DecodeDate(ADate, Y, M, D);
// Inc(Y, N div 12); // Wrong !!!
// Inc(M, N mod 12); // Wrong !!!
  X := ((Y * 12) + M - 1 + N);
  Y := X div 12;
  M := (X mod 12) + 1;
...
TagsNo tags attached.

Activities

2008-09-24 10:36

 

JVTFtest.zip (5,547 bytes)

jfudickar

2008-09-24 14:43

developer   ~0014668

Fixed in SVN

Issue History

Date Modified Username Field Change
2008-09-24 10:36 lomo74 New Issue
2008-09-24 10:36 lomo74 File Added: JVTFtest.zip
2008-09-24 14:43 jfudickar Status new => resolved
2008-09-24 14:43 jfudickar Resolution open => fixed
2008-09-24 14:43 jfudickar Assigned To => jfudickar
2008-09-24 14:43 jfudickar Note Added: 0014668