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 8861489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:30:12+00:00 2026-06-14T15:30:12+00:00

I do have a full calendar and date picker on the same page.i want

  • 0

I do have a full calendar and date picker on the same page.i want that after selecting date,month or day from the full calendar the same data must be loaded to the date picker as well.

<div id="calendar"></div>
<script type='text/javascript'>
        $(function() {
            var date = new Date();
            var d = date.getDate();
            var m = date.getMonth();
            var y = date.getFullYear();
            var opt={
                header: {
                    left: 'prev,next today',
                    center: 'title',
                    right: 'agendaDay,month'
                        },
                weekends:false,
                selectable: true,
                selectHelper: true,
                defaultView: 'agendaWeek',
                select: function(start, end, allDay) {
                    //calendar.fullCalendar('unselect');

                },
            };
    $('#calendar').fullCalendar(opt);

    $("#cworkweek").on("click",function() {
            opt.weekends=false;
            $('#calendar').fullCalendar('destroy');
            $('#calendar').fullCalendar(opt);
            $(".datepicker").datepicker("destroy");
            getdate(1,5);

    });
    $("#cweek").on("click",function() {
            opt.weekends=true;
            $('#calendar').fullCalendar('destroy');
            $('#calendar').fullCalendar(opt);
            $(".datepicker").datepicker("destroy");
            getdate(0,6);
    });
});
</script>

the above code is for full calendar.
and following one is for date picker.

<span id="startDate"></span>-<span id="endDate"></span>
    <div class="datepicker"></div>
    <script type="text/javascript">
    function getdate(sdate,edate)
    {
        var startDate;
        var endDate;
        var selectCurrentWeek = function() {
            window.setTimeout(function (){
                $('.datepicker').find('.ui-datepicker-current-day a').addClass('ui-state-active')
            }, 2);
        }
        $('.datepicker').datepicker({
            numberOfMonths:[2,1],
            dateFormat: 'M dd,yy',
            onSelect: function(dateText, inst) { 
                var date = $(this).datepicker('getDate');
                startDate = new Date(date.getFullYear(), date.getMonth(), date.getDate() - date.getDay()+ sdate);
                endDate = new Date(date.getFullYear(), date.getMonth(), date.getDate() - date.getDay() + edate);
                var dateFormat = inst.settings.dateFormat || $.datepicker._defaults.dateFormat;
                $('#startDate').text($.datepicker.formatDate( dateFormat, startDate, inst.settings));
                $('#endDate').text($.datepicker.formatDate( dateFormat, endDate, inst.settings ));
                var d = new Date(dateText);
                $('#calendar').fullCalendar('gotoDate', d);
                selectCurrentWeek();
            },
            beforeShowDay: function(date) {
                var cssClass = '';
                if(date >= startDate && date <= endDate)
                    cssClass = 'ui-datepicker-current-day';
                return [true, cssClass];
            },

        });
    }
    $(function() {
       getdate(5,1);
    });
    </script>

so kindly suggest me.actually i have done this with date picker as above code.

  • 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-14T15:30:13+00:00Added an answer on June 14, 2026 at 3:30 pm

    The code is not really clear to read, you could use Jsfiddle to show a working example of it.
    In general, you could trigger custom events. For instance, after picking in the calendar the date, you could trigger:

    $('#calendar').trigger({
        type:"date-updated.calendar",
        new_date: 'the-date-of-the-calendar
    });
    

    and somewhere in the datepicker you set

    $('#calendar').on("date-updated.calendar",function(ev){
        var new_date = ev.new_date;
        //update your datepicker with new_date
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On a JSTL/JSP page, I have a java.util.Date object from my application. I need
I really want to have full control of section headers by laying out in
In my live site I have php include() and require() that have full path
I have searched through the full calendar documentation and tried a couple of solutions
I have a standard Jquery date picker which shows 2 textboxes. One textbox has
I have calendar that is working fine. Here is the function that display the
I'm building my first application that requires a calendar. I have it working great
We have a script that generate invoice once a month (cron). But we would
I have a web application that has a dynamic javascript calendar, which allows users
trying to add a sub query that only shows records from the last calendar

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.