Hab es so versucht... klappt aber nicht 100%ig bei der 1. Woche im Jahr und auch von Woche 50.-53. gibt es Probleme weiß jemand warum?
Überprüfe hierbei nur ob der Tag in der Woche liegt! Wenn ja ist es der Montag!
edit1.text := Woche
edit2.text := Jahr
Delphi-Quellcode:
test := '01.01.'+edit2.text;
i := -3;
while not ( IntToStr(WeekOfTheYear(strtodate(test)+i)) = edit1.text ) do begin
i := i + 1;
end;
label3.caption := 'Montag = '+datetostr (strtodate(test)+i+0);
label4.caption := 'Dienstag = '+datetostr (strtodate(test)+i+1);
label5.caption := 'Mittwoch = '+datetostr (strtodate(test)+i+2);
label6.caption := 'Donnerstag = '+datetostr (strtodate(test)+i+3);
label7.caption := 'Freitag = '+datetostr (strtodate(test)+i+4);
label8.caption := 'Samstag = '+datetostr (strtodate(test)+i+5);
label9.caption := 'Sonntag = '+datetostr (strtodate(test)+i+6);
end;
------------------------
gruß
Mitchl55