nihad640 / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

Timeline setStartDate and setEndDate does NO longer work #744

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I upgraded to the nightly build 4.1p and last version of gwt 2.6.1

the timeline does not set properly the startDate and endDate of the component.
Whatever I set on the startDate it seems to be today's date.
My app uses this component for many months, I know it used to work. 

but here is a test to reproduce this defect.

I took the example of the showcase. Same problem.
you will notice that the calendar date is 05/10 to 05/31 despite the settings 
(5/02 to 5/22)in the code below.

public class test implements EntryPoint {
    /**
     * This is the entry point method.
     */
    public void onModuleLoad() {
        Lane[] developers = new Lane[]{  
                new Lane("charlesMadigen", "Charles Madigen"),  
                new Lane("tamaraKane", "Tamara Kane"),  
                new Lane("darcyFeeney", "Darcy Feeney"),  
                new Lane("kaiKong", "Kai Kong"),  
                new Lane("shelleyFewel", "Shelley Fewel"),  
                new Lane("garretMonroe", "Garret Monroe")  
            };  

            Timeline calendar = new Timeline();  
            calendar.setHeight(451);  
            calendar.setStartDate(new Date(112, 5, 2));  
            calendar.setEndDate(new Date(112, 5, 22));  
            calendar.setData(TimelineData.getRecords());  
            calendar.setLanes(developers);  
            calendar.setCanResizeTimelineEvents(true);  
            calendar.setCanEditLane(true);  
            calendar.setShowEventDescriptions(false);  

            HeaderLevel[] headerLevels = new HeaderLevel[]{  
                new HeaderLevel(TimeUnit.WEEK),   
                new HeaderLevel(TimeUnit.DAY)  
            };  
            calendar.setHeaderLevels(headerLevels);  

            calendar.draw();  
    }

}
class TimelineData {  

    private static CalendarEvent[] records;  
    private static Date today = new Date(112, 5, 2);  
    private static int year = today.getYear();  
    private static int month = today.getMonth();  
    private static int start = today.getDate();  

    public static CalendarEvent[] getRecords() {  
        if (records == null) {  
            records = getNewRecords();  
        }  
        return records;  
    }  

    public static CalendarEvent[] getNewRecords() {  
        return new CalendarEvent[]{  
                new CalendarEvent(1, "Add new Timeline view", "Add a new calendar Timeline component", new Date(year, month, start + 2), new Date(year, month, start + 8, 23, 59, 59), "darcyFeeney"),  
                new CalendarEvent(2, "ListGrid field autoSize", "Complex field-autosizing in ListGrid", new Date(year, month, start), new Date(year, month, start, 23, 59, 59), "kaiKong"),  
                new CalendarEvent(3, "PDF Import/Export", "Implement native PDF import/export", new Date(year, month, start + 1), new Date(year, month, start + 6, 23, 59, 59), "garretMonroe"),  
                new CalendarEvent(4, "Calculated Fields", "Formula and Summary fields for ListGrid", new Date(year, month, start), new Date(year, month, start + 4, 23, 59, 59), "charlesMadigan"),  
                new CalendarEvent(5, "ListGrid cell-level selection", "Implement spreadsheet-like selection in ListGrid", new Date(year, month, start + 7), new Date(year, month, start + 14, 23, 59, 59), "charlesMadigan"),  
                new CalendarEvent(6, "Text import", "Server text-import", new Date(year, month, start + 16), new Date(year, month, start + 20, 23, 59, 59), "charlesMadigan"),  
                new CalendarEvent(7, "TabIndex enhancements", "Enhance formItem tabindex handling", new Date(year, month, start + 9), new Date(year, month, start + 11, 23, 59, 59), "kaiKong"),  
                new CalendarEvent(8, "Visual Builder skin", "Skinning changes", new Date(year, month, start), new Date(year, month, start + 3, 23, 59, 59), "shelleyFewel"),  

                new CalendarEvent(9, "DataSource Transaction-handling", "New transaction features", new Date(year, month, start), new Date(year, month, start + 2, 23, 59, 59), "tamaraKane"),  
                new CalendarEvent(10, "New Samples", "Add 20 samples for the following new features: ...", new Date(year, month, start + 4), new Date(year, month, start + 20, 23, 59, 59), "tamaraKane"),  
                new CalendarEvent(11, "Localization", "Extend i18n support", new Date(year, month, start + 9), new Date(year, month, start + 14, 23, 59, 59), "darcyFeeney"),  
                new CalendarEvent(12, "New Language Packs", "Add these 4 new language packs: ...", new Date(year, month, start + 16), new Date(year, month, start + 18, 23, 59, 59), "darcyFeeney"),  

                new CalendarEvent(13, "ComponentXML", "Add the following features and update documentation: ...", new Date(year, month, start + 5), new Date(year, month, start + 11, 23, 59, 59), "shelleyFewel"),  
                new CalendarEvent(14, "TileGrid", "Change styling on builtin tiles as follows: ...", new Date(year, month, start + 14), new Date(year, month, start + 19, 23, 59, 59), "shelleyFewel"),  
                new CalendarEvent(15, "Dev Meeting", "Weekly dev meeting", new Date(year, month, start + 1), new Date(year, month, start + 1, 23, 59, 59), false, "testStyle", "charlesMadigen"),  
                new CalendarEvent(16, "Dev Meeting", "Weekly dev meeting", new Date(year, month, start + 8), new Date(year, month, start + 8, 23, 59, 59), false, "testStyle", "charlesMadigen"),  
                new CalendarEvent(17, "Dev Meeting", "Weekly dev meeting", new Date(year, month, start + 15), new Date(year, month, start + 15, 23, 59, 59), false, "testStyle", "charlesMadigen"),  

                new CalendarEvent(18, "Oracle enhancements", "Add the following 11g-specific enhancements: ...", new Date(year, month, start + 7), new Date(year, month, start + 9, 23, 59, 59), "garretMonroe"),  
                new CalendarEvent(19, "Client export", "Excel export alterations", new Date(year, month, start + 11), new Date(year, month, start + 14, 23, 59, 59), "garretMonroe"),  
                new CalendarEvent(20, "Record Components", "New ListGrid recordComponent modes: ...", new Date(year, month, start + 16), new Date(year, month, start + 20, 23, 59, 59), "garretMonroe"),  
                new CalendarEvent(21, "SQLDataSource", "Enhancements to customSQL support", new Date(year, month, start + 2), new Date(year, month, start + 4, 23, 59, 59), "kaiKong"),  
                new CalendarEvent(22, "includeFrom", "Update support via includeFrom", new Date(year, month, start + 6), new Date(year, month, start + 8, 23, 59, 59), "kaiKong"),  
                new CalendarEvent(23, "FileItem", "Add milti-file upload support", new Date(year, month, start + 14), new Date(year, month, start + 16, 23, 59, 59), "kaiKong"),  
                new CalendarEvent(24, "Doc viewer", "Enhance documentation viewer with these additional syntax-hilites: ...", new Date(year, month, start + 18), new Date(year, month, start + 19, 23, 59, 59), "kaiKong")  
        };  
    }  
}  

Original issue reported on code.google.com by etel...@gmail.com on 10 May 2014 at 2:02

GoogleCodeExporter commented 9 years ago
I forgot to add these are the browsers I use where the problem occurs:
Chrome Version 33.0.1750.146
and firefox v24.5.0

My OS is ubuntu  12.04 lts

Thx for addressing this issue quickly.

Original comment by etel...@gmail.com on 11 May 2014 at 12:57

GoogleCodeExporter commented 9 years ago
Issue resolved....my application server was not picking up the module compiled 
with the last night build...usually. it does. I had to stop the app server 
(grails run-app), compile the module then restart server.

Close this issue.

Original comment by etel...@gmail.com on 11 May 2014 at 4:19

GoogleCodeExporter commented 9 years ago

Original comment by smartgwt...@gmail.com on 11 May 2014 at 4:24