• Resolved Nathan

    (@natedanielz)


    Hi, something strange is happening. When you select 25/03/2024 in the calendar (Selecteer een week), you see under “Overzicht” it shows week 13, which is correct. But when I then select the week after, 01/04/2024, it also says it’s week 13. How come? Alle weeks after are obviously a week number behind, until you select 28/10/2024. Then it skips a week and the week numbers are correct again.

    Can you please help find the issue?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @natedanielz,

    My apologies for the delay in responding to your question. I’ve found a minor error in the WEEKNUM operation. Please insert an “HTML Content” field in the form and enter the following piece of code as its content:

    
    function WEEKNUM( date, format, leading_zeros ){
    format = format || null;
    leading_zeros = leading_zeros || false;
    var d = DATEOBJ( date, format ), i, n, r = false;
    if ( d.valid() ) {
    i = new Date(d.getFullYear(), 0, 1, 0, 0, 0, 0);
    n = ( d - i ) / ( 24 * 60 * 60 * 1000 );
    r = Math.max( Math.ceil( (n+1) / 7 ), 1 );
    if ( leading_zeros ) r = _leadingZeros( r );
    }
    return r;
    };

    We will include the modifications in the next plugin update.

    Best regards.

    Thread Starter Nathan

    (@natedanielz)

    Hi,

    No worries, thanks for the quick response. I’ve done what you asked, but the code shows on the front end.

    EDIT: I forgot the script tags. It works, thanks!

    • This reply was modified 10 months, 3 weeks ago by Nathan.
    Plugin Author codepeople

    (@codepeople)

    Hello @natedanielz

    We’ve included the code fixing in the last night plugin update. Please install it.

    Best regards.

    Thread Starter Nathan

    (@natedanielz)

    Great, thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Week numbers incorrect from 1st April 2024’ is closed to new replies.