Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9081307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:17:03+00:00 2026-06-16T20:17:03+00:00

Hello everybody and thanks for taking the time to read this . Iam working

  • 0

Hello everybody and thanks for taking the time to read this .
Iam working with jquery callendar and iam trying to build a custom view , i was wandering if i am using the agendaweek view to view all the days in that week how can i block the calendar for only one week in the future ? What i mean is that i just want it to show for one week in the future and no more. This is my configuration ;

$('#calendar').fullCalendar({
            header: {
                left: 'next today',
                center: 'title',
                right: 'week'
            },
                        defaultView: 'basicWeek',
            editable: true,
            events: [<?php echo $calendar_events?>
                                ]
                    });

    });

Thanks everybody in advanced

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T20:17:05+00:00Added an answer on June 16, 2026 at 8:17 pm

    simple solution for 1 week blockage in week view. For this code to work you need getWeekNumber function from http://www.merlyn.demon.co.uk/weekcalc.htm#WNR

    /* For a given date, get the ISO week number
    *
    * Based on information at:
    *
    *    http://www.merlyn.demon.co.uk/weekcalc.htm#WNR
    *
    * Algorithm is to find nearest thursday, it's year
    * is the year of the week number. Then get weeks
    * between that date and the first day of that year.
    *
    * Note that dates in one year can be weeks of previous
    * or next year, overlap is up to 3 days.
    *
    * e.g. 2014/12/29 is Monday in week  1 of 2015
    *      2012/1/1   is Sunday in week 52 of 2011
    */
    function getWeekNumber(d) {
       // Copy date so don't modify original
       d = new Date(d);
       d.setHours(0,0,0);
       // Set to nearest Thursday: current date + 4 - current day number
       // Make Sunday's day number 7
       d.setDate(d.getDate() + 4 - (d.getDay()||7));
       // Get first day of year
       var yearStart = new Date(d.getFullYear(),0,1);
       // Calculate full weeks to nearest Thursday
       var weekNo = Math.ceil(( ( (d - yearStart) / 86400000) + 1)/7)
       // Return array of year and week number
       return [d.getFullYear(), weekNo];
    }
    

    What you need to do is to check current week number after loading view:

    $('.calendar-container').fullCalendar({
        viewDisplay: function(view) {
            var selectedWeekNumber = getWeekNumber($('.calendar-container').fullCalendar('getView').start);
            var currentWeekNumber = getWeekNumber(new Date());
    
            if (selectedWeekNumber[1] == currentWeekNumber[1]) {
                $('a.date-link.prev').hide();
                $('a.date-link.next').show();
            } else {
                $('a.date-link.prev').show();
                $('a.date-link.next').hide();
            }
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello everybody and thanks for taking the time to read this ; I was
Hello all and thanks for your time reading this. I need to verify certificates
Hello everybody and thanks for your time. I'm developing some kind of monitoring application
Hello everybody and thanks for reading. I have this html; <i class=icon-plus icon-white> Test
Hello everybody and thanks for interest some time ago i have started to use
Hello everybody my linq to sql selection does not working on dateTime field for
Hello all I am working on javascript jquery and svg.I want to ask a
Hello everybody let me give you the background first: I'm working on a project
Hello everybody I have a problem with exception. The following code block do this
Hello Everybody and thank you in advance for your help! I am trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.