package com.bug;

import com.smartgwt.client.types.TimeUnit;
import com.smartgwt.client.widgets.calendar.HeaderLevel;
import com.smartgwt.client.widgets.calendar.Timeline;
import com.smartgwt.client.widgets.grid.ListGridField;

import java.util.Date;

import com.google.gwt.core.client.EntryPoint;
  
public class TestBug implements EntryPoint {  
    private static Date today = new Date();  
    private static int year = today.getYear();  
    private static int month = today.getMonth();  
    private static int start = today.getDate();  
  
    public void onModuleLoad() {  
        Timeline calendar = new Timeline();  
        calendar.setHeight(451);  
        calendar.setStartDate(new Date(year, month, start - 5));  
        calendar.setCanEditLane(true);  
        calendar.setShowEventDescriptions(false);  
  
        HeaderLevel[] headerLevels = new HeaderLevel[]{  
            new HeaderLevel(TimeUnit.WEEK),   
            new HeaderLevel(TimeUnit.DAY)  
        };  
        calendar.setHeaderLevels(headerLevels);  
        calendar.setShowDragHovers(true);
        calendar.setDisableWeekends(true);
        calendar.setResolution(headerLevels, TimeUnit.DAY, 7 * 3, null);

        calendar.setLaneFields(new ListGridField[]{ new ListGridField("title", "Developer", 120)});  
        calendar.setLanes(TimelineLaneData.getRecords());  
        calendar.setData(TimelineData.getRecords());  
  
        calendar.draw();  
    }  
}  

