procedure TForm1.rg1Click(Sender: TObject);
var
Trh1,Trh2 : TDateTime;
Yil,Ay,Gun : Word;
begin
Yil := se.value;
Ay := cb.Itemindex+1;
if (Yil=0) or (Ay=0) then exit;
case rg1.Itemindex of
0 : begin
Gun := 1;
Trh1 := EncodeDate(Yil,Ay,Gun);
Trh2 := Trh1+9;
dtp1.Date := Trh1;
dtp2.Date := Trh2;
end;
1 : begin
Gun := 11;
Trh1 := EncodeDate(Yil,Ay,Gun);
Trh2 := Trh1+9;
dtp1.Date := Trh1;
dtp2.Date := Trh2;
end;
2 : begin
Gun := 21;
Trh1 := EncodeDate(Yil,Ay,Gun);
Ay := Ay+1;
Trh2 := EncodeDate(Yil,Ay,1)-1;
dtp1.Date := Trh1;
dtp2.Date := Trh2;
end;
end;
if rg2.Itemindex>0 then
begin
dtp1.date:=dtp1.date+rg2.ItemIndex;
dtp2.date:=dtp2.date+rg2.ItemIndex;
end;
end;