| |
|
|
Langer | Hello together,
I Search to one lane from the amount the days between two Datumswerten The weekends out To calculate. z.B. Urlaubsberechnung of tuesday whom 4.4.2017 To tuesday whom 11.4.2017 are incl. 4. and 11. 8 days. Urlaubstage but only 6 there the weekend eh spare is. somehow wants it I do not gelinge this a suitable Formel To erdenken. has someone already once so a Berechnung employed?
Dirk |
|
|
| |
|
|
|
p.specht
| Gültigkeitszeitraum Gregorianischer Calendar? or sufficient our centenary? which XProfan-Version (ex X2 there comfortable functions to Wochentagsberechnung + The Hilfsfunktion dow() Day of Week)
for ältere Profanversionen How 11.2a would the nachstehende Proc Perhaps integrally useable. greeting
Window Title "Direkte Wochentagsermittlung from Datum"
' Version 1.02_beta, without each Gewähr or warranty
declare there$,dy%,mnth%,fyear%,syear%,kal$,i%,j%,h%,greg%
Window 424,300
again:
cls rgb(0,100,255)
print
print " Algorithmus " + chr $(34) + "Zeller´s Kongruenz" + chr $(34) + " "
print " fountain: priest Dr.math. Christian Zeller A.D.1882 "
print
print " date [dd.mm.yyyy] = ";
locate 5,24 : input there$
case there$="" : end
dy%=val(left$(there$,2))
mnth%=val(mid$(there$,4,2))
fyear%=val(mid$(there$,7,4))
syear%=val(mid$(there$,9,2))
print
print
if fyear% > 1582 : greg%=1
elseif fyear% < 1582 : greg%=0
elseif fyear% = 1582
if mnth%>10 : greg%=1
elseif mnth%<10 : greg%=0
elseif mnth%=10
if dy%>=15 : greg%=1
elseif dy%<=4 : greg%=0
else
greg%=-1
endif
endif
endif
kal$=" Julianischer Calendar 45vChr-4.10.1582 "
case greg%=1 : kal$=" Gregorianischer Calendar "
case greg%=-1: kal$=" KEIN CALENDAR ZUFREFFEND! "
Print kal$
Print " The " + st$(dy%)+"."+st$(mnth%)+"."+st$(fyear%)+" falls on a ";
if mnth%<3
mnth%=mnth%+12
fyear% = fyear%-1
syear% = syear%-1
endif
h%=-1
if greg%=1
h%=(dy%+int((mnth%+1)*26/10)+syear%+int(syear%/4)+int( int(fyear%/100) /4) + 5*int(fyear%/100) ) mod 7
elseif greg%=0
h%=(dy%+int((mnth%+1)*26/10)+syear%+int(syear%/4)+ 5 + 6* int(fyear%/100) ) mod 7
else
h%=99
endif
if h%=0 : print "Samstag";
elseif h%=1 : print "Sonntag";
elseif h%=2 : print "Montag";
elseif h%=3 : print "Dienstag";
elseif h%=4 : print "Mittwoch";
elseif h%=5 : print "Donnerstag";
elseif h%=6 : print "Freitag";
elseif h%=99: print " "
print " not existierenden period (because of "
print " grego. Kalenderreform boisterously)";
else : print " fehlerhaften Eingabewert";
endif
print ". "
WaitInput
Goto "nochmal"
in the principle is namely ohnehin Einzeltagsbetrachtung angesagt, because of the irregular holidays, also yet bundesländerweise differently is. Recommendable: "Kastner: Terminplanung with Basic on Commodore" (aniquarisch Perhaps?) |
|
|
| Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 04/04/17 ▲ |
|
|
|
|
Langer | Hello p.woodpecker, thanks for your mail. the was not yet the I really meant.
i'm meanwhile The suitable idea come.
Declare hWin1&, hButton1&, Ende&, hDate1&, hWin2&, hButton2&, hDate2&, Date&, days%, A&, b%
hWin1& = @Create("Dialog", %hWnd, "1. Urlaubstag", 100, 100, 200, 200)
hDate1& = @Create("DateEdit", hWin1&, "", 10, 50, 100, 24)
hWin2& = @Create("Dialog", %hWnd, "letzter Urlaubstag", 350, 100, 200, 200)
hButton2& = @Create("Button", hWin2&, "Ende", 10, 90, 180, 24)
hDate2& = @Create("DateEdit", hWin2&, "", 10, 50, 100, 24)
Clear Ende&
WhileNot Ende&
WaitInput
If @GetFocus(hButton2&)
Ende& = 1
EndIf
EndWhile
Def @Date(1) dt("setDate",val(substr$(substr$(@$(1),1," "),-1,".")), val(substr$(substr$(@$(1),1," "),2,".")), val(substr$(substr$(@$(1),1," "),1,".")))
Def @DateDiff(2) dt("DateTimeStr", "dd.mm.yyyy", Date(@$(1))-Date(@$(2)))
Def @DaysBetween(2) val(abs(30-val(substr$(substr$(DateDiff(@$(1),@$(2)),1,"|"),1,"."))))
Var Time1$=@GetText$(hDate1&)
Var Time2$=@GetText$(hDate2&)
Var d! = dt("SetDate",@GetText$(hDate1&))
Var wtag& = dt("getDoW",d!)
Declare week-day$
Case wtag& = 1 : week-day$ = "Montag"
Case wtag& = 2 : week-day$ = "Dienstag"
Case wtag& = 3 : week-day$ = "Mittwoch"
Case wtag& = 4 : week-day$ = "Donnerstag"
Case wtag& = 5 : week-day$ = "Freitag"
Case wtag& = 6 : week-day$ = "Samstag"
Case wtag& = 7 : week-day$ = "Sonntag"
b% = DaysBetween(Time1$, Time2$)
Tage% = b% + wtag&
Case days% < 7 : A& = 0
Case days% > 7 : A& = 2
Case days% > 14 : A& = 4
Case days% > 21 : A& = 6
Case days% > 28 : A& = 8
Date& = (DaysBetween(Time1$, Time2$) + 1) - A&
print Time1$
print Time2$
print
print DaysBetween(Time1$, Time2$) + 1;" day(e)"
print
print "der first day is a " + week-day$
print
print "das corresponds to ";Date&;"Tagen Urlaub"
A& = 0
waitInput
missing yet The Feiertagsüberprüfung, but since Have so did i already a idea. mandatory I but first testing. |
|
|
| |
|
|
|
p.specht
| |
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 04/04/17 ▲ |
|
|
|
|
ByteAttack | I can it only you say How one it through Excel can make.... [...]
and for data use I The MWDATE.DLL |
|
|
| |
|
|