calculate week number of year
Hello, I need to calculate the number of weeks in a year from a date entered in a field.
Hello, I need to calculate the number of weeks in a year from a date entered in a field.
It works very well but I need the result to be in double digits.
For example:
If I type 210916 the result is 37, but if I type 220103 the result is 1, this result is correct but I am interested that it is 01.
JANUARY > 01
FEBRUARY > 02
MARCH > 03
APRIL > 04
MAY > 05...
After this line:
event.value = getWeekNumber(d);
Add this:
if (event.value.length==1) event.value = "0"+event.value;
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.