Find Jobs
Hire Freelancers

Function NumDayOfWeek - VB6 to Javascript

$10-30 USD

Terminado
Publicado hace alrededor de 8 años

$10-30 USD

Pagado a la entrega
This job is to convert 2 functions (NumDayOfWeek and DowsInMonth) from VB6 into Javascript. I need this immediately. Please be prepared to begin work immediately. 1. Convert this NumDayOfWeek function from VB6 into Javascript. '// This function returns the date of the day of the week specified '// by month, number of weekday occurred in the month, and the '// day of the week. '// Mth is "Month", Num is passed "number of weekday occurred in the month, '// and Dow is passed for '// "Day of Week", the date (day) is returned as the result. Public Function NumDayOfWeek(Mth As Long, Num As Long, Dow As Long) As Long '// Day of week (Dow) reference '// 1 = Sunday 2 = Monday 3 = Tuesday 4 = Wednesday '// 5 = Thursday 6 = Friday 7 = Saturday '// Return the actual date. NumDayOfWeek = (8 - Weekday(DateSerial(theYear, Mth, 1), (Dow + 1) Mod 8)) + ((Num - 1) * 7) End Function NOTES: DateSerial is a VB6 function. You will need to study what it did, from the VB6 references online, and reproduce it's functionality. I think it simply creates dates by imputting Year, Month, Day, so the Javascript New Date() function should work. WeekDay is a VB6 function. You will need to study what it did, from the VB6 references online, and reproduce it's functionality. I already found one source code example of this, in Javascript, in the attached file. theYear is supposed to hold the current year. But the line of code that sets that global variable, wass outside theVB6 function. Instead of that, I'd like the Javascript version to set the current year, inside the NumDayOfWeek function. Here are examples of calling the NumDayOfWeek function. These are random lines of code, gathered together, in VB6. DSTStartDateStamp = 300 + NumDayOfWeek(3, 2, 1) '// Second Sunday of March (should return 13 ) DSTEndDateStamp = 1100 + NumDayOfWeek(11, 1, 1) '// First Sunday of November (should return 6) DSTStartDateStamp = 300 + NumDayOfWeek(3, DowsInMonth(3, 1), 1) '// Last Sunday of March (should return 27 ) DSTEndDateStamp = 1000 + NumDayOfWeek(10, DowsInMonth(10, 1), 1) '// Last Sunday of October (should return 30) 2. Convert this DowsInMonth function from VB6 into Javascript. '// This function calculates the number of time the specified week day '// occurs in the specified month. '// Mth is passed for "Month", Dow is passed for '// "Day of week", Number of day occurances is returned, Public Function DowsInMonth(Mth As Long, Dow As Long) As Long On Error Resume Next '// In case DateSerial function runs into an invalid date for the month. Dim DowLoop As Long '// Variable for date loop Dim DowCalc As Long '// Used to calculate the number of days before returning it. Dim MonthDayLimit As Long '// Limit of days in the month to loop through. '// Get the last day of the month specified. MonthDayLimit = Day(DateSerial(theYear, Mth + 1, 0)) '// Reset the Days of week count for the month DowCalc = 0 '// Count how many days of the weekday specified that are in the month For DowLoop = 1 To MonthDayLimit If Weekday(DateSerial(theYear, Mth, DowLoop)) = Dow Then DowCalc = DowCalc + 1 End If Next DowLoop '// Return the number of days found. DowsInMonth = DowCalc End Function NOTES: Forget about "On Error Resume Next". That's not needed for the Javascript version. theYear was a global set to current year (2016), For the Javascript version, set it to current year inside this function. DateSerial is a VB6 function, which you hopefully figured out and converted into Javascript in part 1. Day is a VB6 function, which you can read about in the Visual Basic VB6 online documentation. The Javascript .getDate() should work instead. WeekDay is a VB6 function, which you hopefully figured out and converted into javascript in part 1.
ID del proyecto: 9931226

Información sobre el proyecto

3 propuestas
Proyecto remoto
Activo hace 8 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
Dear Hiring Manager, we will do it for you with perfection and we will keep working on it until you are 110% satisfied with results. Feel free to message me. we can discuss price and project in [login to view URL] are looking for opportunities to excel in this [login to view URL] us a chance to prove ourselves. Thank You
$30 USD en 1 día
5,0 (26 comentarios)
4,5
4,5
3 freelancers están ofertando un promedio de $23 USD por este trabajo
Avatar del usuario
Lets start.....Lets start.....Lets start.....Lets start.....Lets start.....Lets start.....Lets start.....Lets start.....
$15 USD en 1 día
5,0 (35 comentarios)
4,5
4,5
Avatar del usuario
A proposal has not yet been provided
$25 USD en 1 día
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de CANADA
Edmonton, Canada
5,0
157
Forma de pago verificada
Miembro desde dic 3, 2009

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.