Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I create more than one calendar and link them together? #60

Open
isteven opened this issue Sep 28, 2016 · 1 comment
Open

How do I create more than one calendar and link them together? #60

isteven opened this issue Sep 28, 2016 · 1 comment

Comments

@isteven
Copy link

isteven commented Sep 28, 2016

Hi,

I need to create two calendars, showing current month & current month + 1 (for example, september and october 2015).

These calendar would be linked together; if I click the "Next" button on one calendar, the other one will also advance to the next month, like:

Calendar 1: September 2016
Calendar 2: October 2016

I click "Next" on calendar 1, then they'll be:

Calendar 1: October 2016
Calendar 2: November 2016

What is the best way to do this?

Thanks.

@twinssbc
Copy link
Owner

@isteven
You can control the calendar navigation by changing the ng-model variable.
Let's say the first calendar is bound to currentDate, the second calendar is bound to currentDate2.
Then in the rangeChanged callback of first calendar, you can do something like:

    $scope.rangeChanged = function (startTime, endTime) {
        var time = new Date($scope.currentDate);
        time.setMonth($scope.currentDate.getMonth() +1);
        $scope.currentDate2 = time;
    };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants