Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

How to switch to desired month? #47

Open
develop-mcoblefias opened this issue Sep 15, 2020 · 1 comment
Open

How to switch to desired month? #47

develop-mcoblefias opened this issue Sep 15, 2020 · 1 comment

Comments

@develop-mcoblefias
Copy link

develop-mcoblefias commented Sep 15, 2020

Version

v1.1.1

Test Environment

Windows10, Chrome

Current Behavior

I want to call vue-calendar from another component. The other component is a full year calendar.
From the full year calendar component, I pass the month and year info but I do now know how to pass it into vue-calendar.
I saw in the month.js that there is a renderMonth property under monthOption but it doesn't seem to change to the month I want.

//month.js
this.options = util.extend({
        scheduleFilter: function(schedule) {
            return Boolean(schedule.isVisible);
        },
        startDayOfWeek: 0,
        renderMonth: '2018-01',     // <---- this one
        daynames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
        narrowWeekend: false,
        visibleWeeksCount: null,
        isAlways6Week: true,
        isReadOnly: options.isReadOnly,
        grid: {
            header: {
                height: 34
            },
            footer: {
                height: 3
            }
        }
    }, monthOption);

//inside my vue file
data() {
  return {
    month: {
      visibleWeeksCount: 0,
      startDayOfWeek: 0,
      narrowWeekend: true,
      isAlways6Week: false,
      renderMonth: '2020-01'   // <---- then this
    }
  }
}

Expected Behavior

I am already able to display the default month view and display some schedules. It's just that I want to show the desired month based from the full year component.

@nhn nhn deleted a comment from swtalk Sep 16, 2020
@nhn nhn deleted a comment from swtalk Sep 16, 2020
@nhn nhn deleted a comment from develop-mcoblefias Sep 16, 2020
@jungeun-cho
Copy link
Contributor

'renderMonth' property is not official property.
https://nhn.github.io/tui.calendar/latest/MonthOptions

You can use 'setDate' method.
https://nhn.github.io/tui.calendar/latest/Calendar#setDate

// for example...
initialize() {
  this.$refs.tuiCalendar.invoke("setDate", new Date(2020, 8));
}

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

No branches or pull requests

2 participants