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

The bug occurs when timezoneName is set to Etc/UTC and the start time is 00:00:00. #1461

Open
cwygp opened this issue Oct 21, 2024 · 0 comments

Comments

@cwygp
Copy link

cwygp commented Oct 21, 2024

Version

@toast-ui/react-calendar": "^2.1.3"

const CalendarUI2 =  () => {
    const calendars = [{ id: 'cal1', name: 'Personal'}];
    const calendarRef = useRef();
    const [tasks, setTasks] = useState([]);
    
    const onloaded = () => {
      const calendarInstance = calendarRef.current.getInstance();
      calendarInstance.setOptions({
        timezone: {
          zones: [
            {
              timezoneName: 'etc/UTC',
              displayLabel: 'UTC',
              tooltip: 'UTC Time',
            },
            {
              timezoneName: 'Asia/Seoul',
              displayLabel: 'Seoul',
              tooltip: 'Seoul Time',
            },
          ],
        }
      });
      
      let taskArr = [];
      for (let index = 1; index < 10; index++) {
        taskArr.push({
          id: index,
          calendarId: 'cal1',
          title: index,
          category: 'time',
          start: new TZDate('2024-10-0'+(index )+'T00:00:00'),
          end: new TZDate('2024-10-0'+(index )+'T01:00:00'),
          customStyle : {
            color : "white"
          }
        });
        
      }
      setTasks(taskArr);

    }
    
      useEffect(() => {
        onloaded();
        
      }, [])

    return <Box p={10} maxH="800px">
      <VStack spacing={4} align='stretch'>
        <Calendar
          view={'month'}
          usageStatistics={false}
          calendars={calendars}
          events={tasks}
          ref={calendarRef}
          useDetailPopup={false}
          useFormPopup={false}
        />
      </VStack>
    </Box>
}




## Expected Behavior
The above code is causing an error, possibly due to the timezone configuration. Is there a solution to fix this?

![image](https://github.com/user-attachments/assets/07283f1d-87a4-47b8-9efa-6cf53ff918fb)
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

1 participant