| |
|
|
Sato Pinto | Hello on all sides
knows someone whether the DateEdit control too whom Number of weeks outputs or remaining only The Possibility the To to charge?
greeting Sato |
|
|
| |
|
|
|
Nico Madysa | of my Wissens gives the Date-Edit only the from, what it too indicating. The number the chosen week müsstest You means self calculate. |
|
|
| |
|
|
|
Jac de Lad | Yes, very. Lies still the date from and lass you with the mwdate.dll The week to charge. |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 09/26/08 ▲ |
|
|
|
|
Sato Pinto | Hello Jac
thanks for hint, but I faith The DLL has The weeks number function not, or I have it overlooking
greeting Sato |
|
|
| |
|
|
|
Jörg Sellmeyer | look time, whether you that here weiterhilft: [...] and the: [...] |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 09/26/08 ▲ |
|
|
|
|
Thomas Freier | or the Calendar from the MMJ-Quellcodesammlung: [...] |
|
|
| Gruß Thomas Windows XP SP2, XProfan X2 | 09/27/08 ▲ |
|
|
|
|
Sato Pinto | Hello from the named Solutions functions only the Calendar with the Wochennummern from the MMJ-Quellcodesammlung, still see I no Möglickeit only The Wochennummer from it To fish. knows someone whether the possibly is?
greeting Sato |
|
|
| |
|
|
|
Sato Pinto | Hello apparently is the Wochennummer berechnung no so light thing. have a little bit gegoogelt and this code in PowerBasic found. is it possibly it to XProfan umzusetzen? Fals it klappen ought to becomes it certainly sometime too for others User usual his.
greeting Sato CompileMarkSeparation*******************************************************
* Function Julian - returns Julian Day Number (JDN) *
* Actually it counts days elapsed since "11/25/-4713" *
* (= Nov. 25, 4714 BCE) *
*******************************************************
FUNCTION Julian(BYVAL year AS LONG, _
BYVAL month AS LONG, _
BYVAL day AS LONG) AS LONG
LOCAL Days AS LONG, yearsBC AS LONG, yearsAD AS LONG
IF month < 3 THEN January or February?
month = month + 12 13th or 14th month ....
DECR year .... of prev. year
END IF
yearsBC = 4714 - 1 4713 BC thru 1 BC
yearsAD = year - 1 1 AD thru (year of date minus 1)
Days = INT((yearsBC + yearsAD) * 365.25) calculate days in years
Days = Days - (year 100) substract century leapdays
Days = Days + (year 400) re-add valid ones
Days = Days + INT(30.6 * (month - 1) + .2) days in months elapsed (+ adjustment)
FUNCTION = Days + day days in month of date
END FUNCTION
***********************************************
* Function DayOfWeek returns day of the week, *
* where Monday = 1 .... Sunday = 7 *
***********************************************
FUNCTION DayOfWeek(JDN AS LONG) AS BYTE
FUNCTION = JDN MOD 7 + 1
END FUNCTION
***********************************************************************
* Function WeekOne returns first day of first week for the given year *
* Note: This is only a helper function for WeekNumber *
***********************************************************************
FUNCTION WeekOne(BYVAL year AS LONG) AS LONG
LOCAL temp AS LONG, Thursday AS BYTE
Thursday = 4
temp = Julian(year, 1, 1) - 1 Dec. 31 of prev. year
DO
INCR temp
LOOP UNTIL DayOfWeek(temp) = Thursday until first Thursday of year is found
FUNCTION = temp - 3 first day of first week is a Monday
END FUNCTION
*********************************************************************
* Function WeekNumber returns ISO-proof weeknumber for a given date *
*********************************************************************
FUNCTION WeekNumber(BYVAL year AS LONG, _
BYVAL month AS LONG, _
BYVAL day AS LONG) AS BYTE
LOCAL FirstDay AS LONG, FinalDay AS LONG, ToDay AS LONG
LOCAL WkNumber AS BYTE
FirstDay = WeekOne(year)
FinalDay = WeekOne(year + 1) - 1
ToDay = Julian(year, month, day)
SELECT CASE ToDay
CASE < FirstDay it is week 52 or 53, but which one?
therefore we need week one of previous year as a starting point
FirstDay = WeekOne(year - 1)
CASE > FinalDay there is only one possibility: week nbr 1
FUNCTION = 1
EXIT FUNCTION
END SELECT
FUNCTION = ((ToDay - FirstDay) 7) + 1
END FUNCTION
FUNCTION PBMain() AS LONG
MSGBOX "Dec. 31, 1997 falls in week " & FORMAT$(WeekNumber(1997, 12, 31)) & $CRLF & _
"Jan. 1, 1999 in week " & FORMAT$(WeekNumber(1999, 1, 1))
END ef='./../../references-fonction/XProfan/function/'>FUNCTION
|
|
|
| |
|
|
|
Thomas Freier | is it the, what You need can: infdatum.zipper of [...] ? |
|
|
| Gruß Thomas Windows XP SP2, XProfan X2 | 09/27/08 ▲ |
|
|
|
|
Jörg Sellmeyer | i see your trouble, sincere said, not. here's still a function/procedure "Week" drin, The very the power, what You seek: [...] |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 09/27/08 ▲ |
|
|
|
|
Sato Pinto | Hello Thomas
Vielen Thanks, this is very I need. having already whom Link visit, have it overlooking. Gerhard Putschalka Page is a repository. too one best Thanks on it
greeting Sato |
|
|
| |
|
|
|
Sato Pinto | Hello Jörg
have it tested, but come lest clear so as understood have must I to week a date prompt. z.b week 28092008 have different Formate attempts: week "28-09-2008" or week 20080928 but none supply one richtiges Result. make I what wrong?
greeting Sato |
|
|
| |
|
|