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

the color of the dynamically generated galendar does not apply to the schedule. #28

Open
qkrtngus2085 opened this issue Jul 15, 2019 · 2 comments
Labels
Answer Category: Usage Question Further information is requested

Comments

@qkrtngus2085
Copy link

qkrtngus2085 commented Jul 15, 2019

hello.
I'm currently using the calendar from toast-ui.

dynamically generated calendars will pop up correctly.

however, the color of the schedule generated by that label is not displayed correctly.
The color of the generated calenadr is red, but the color of the schedule generated by that calenadr appears green.

When you refresh the page, it looks correctly.

watch: {
    labelCalendarList (valueList) {
        valueList.map ((value) => {
            this.$refs.tuiCalendar.invoke("setCalendarColor", value.id, {
                color: value.color,
                borderColor: value.borderColor,
                bgColor: value.bgColor,
            }); 
        });
    }
}

The problem was resolved through the code.

@jungeun-cho jungeun-cho added Category: Usage Question Further information is requested labels Jul 16, 2019
@jungeun-cho
Copy link
Contributor

@qkrtngus2085
Set the calendarId to a nonzero number.

or

How about setting a calendarId as a string?

The calendarId should match the calendarId in the schedule data!

scheduleList: [
  {
     id: '1',  // scheduleId
     calendarId: '0', // calendarId (nonzero number or string)
     title: 'TOAST UI Calendar Study',
     category: 'time',
     dueDateClass: '',
     start: today.toISOString(),
     end: getDate('hours', today, 3, '+').toISOString()
  },
  {
    id: '2', // scheduleId
    calendarId: '1',  // calendarId
    title: 'Practice',
    category: 'milestone',
    dueDateClass: '',
    start: getDate('date', today, 1, '+').toISOString(),
    end: getDate('date', today, 1, '+').toISOString(),
    isReadOnly: true
  },
...
labelCalendarList: [
  {
    id: '0',  // calendarId
    name: 'Company',
    color: '#000',
    borderColor: '#ffe082',
    bgColor: '#ffe082'
  },
  {
    id: '1', // calendarId
    name: 'Family',
    color: '#000',
    borderColor: '#c0ef97',
    bgColor: '#c0ef97'
  }
]
...

@mariusa
Copy link

mariusa commented Oct 14, 2019

Hi,

Is this related to nhn/tui.calendar#432 ?

In your example above it seems it works (as it should).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Answer Category: Usage Question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants