Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    when calendar timeline set TimeUnit.WEEK and setFirstDayOfWeek=0 then property 'endDate' of null

    I have some question about using calendar timeline in setting TimeUnit.WEEK and setFirstDayOfWeek=0 (firstDayOfWeek is sunday)
    in SmartGWT 12.0p .

    I have check some setting , when i set calendarTimeline.setFirstDayOfWeek(0) and
    setResolution in TimeUnit.WEEK then it become like this Click image for larger version

Name:	1.png
Views:	55
Size:	128.0 KB
ID:	265755

    the week of 2021-03-21 to 2021-03-27 and 2021-04-11 to 2021-04-17 's
    CalendarEvent can't be displayed correct (
    especially in 2021-04-11 to 2021-04-17 's CalendarEvent), and if i click the gap of CalendarEvent then it throws
    Uncaught TypeError: Cannot read property 'endDate' of null

    Click image for larger version

Name:	Screenshot_20210624_090556.png
Views:	47
Size:	338.6 KB
ID:	265756
    and calendarTimeline.setEndDate(endDate); seems not working .


    calendarTimeline.setStartDate(startDate); //03/21
    calendarTimeline.setEndDate(endDate); //04/17
    CalendarEvent 's startDate and endDate are 03/21 to 03/27 、 03/28 to 04/03 、 04/04 to 04/10 、 04/11 to 04/17


    but if i didn't set calendarTimeline.setFirstDayOfWeek(0) it displays correct

    thank for you help
    Attached Files

    #2
    Thanks for the report - you didn't mention your build-date and there have been recent enhancements to Calendar/Timeline - so, the first thing to do is retest with the latest patched build of 12.0 from smartclient.com/builds.

    If that doesn't address your problem, please show test-code we can run to see the problem (including your Timeline setup and DataSource or test-event).

    Also, please confirm your OS/Browser and timezone.
    Last edited by Isomorphic; 23 Jun 2021, 21:17.

    Comment


      #3
      thank's for your replay

      i have tested "builds/SmartGWT/12.0p/LGPL/2021-04-20" 、2021-04-26 and latest version of SmartGWT ,
      running in opensuse 15.2 、 google chrome
      91.0.4472.114 、 Firefox 78.10.0esr 。

      they have different display result but still not i want (only dispaly 4 week header and calendarEvent correct display it's width)

      where are some test code in Attachments ,
      but i can't reproduce the error of "Uncaught TypeError: Cannot read property 'endDate' of null" in that test code ...
      so...how can i set calendarline only display 4 header during 4 week and firstDay of week is sunday 。

      Thank you for all your assistance。
      Attached Files

      Comment


        #4
        the power of "Rubber Duck Debugging" !? 囧
        after post the replay , i have changed my mind about using

        calendar.setResolution(new HeaderLevel[]{new HeaderLevel(TimeUnit.MONTH) , new HeaderLevel(TimeUnit.DAY) } ,TimeUnit.DAY, 28, 7);

        instead of

        calendar.setResolution(new HeaderLevel[]{new HeaderLevel(TimeUnit.MONTH) , new HeaderLevel(TimeUnit.WEEK) } ,TimeUnit.WEEK, 4, 1);

        then..... it run correct and display perfect , only display 4 week header and CalendarEvent's width correct .
        whatever in builds 2021-04-20 、2021-04-26 or latest version 。
        Click image for larger version

Name:	Screenshot_20210624_223715.png
Views:	56
Size:	203.7 KB
ID:	265764

        Hmm …
        calendarTimeline.setFirstDayOfWeek(0) and setResolution in TimeUnit.WEEK
        seems have some problem that I don’t get .

        maybe in TimeUnit.WEEKs Calculation or Offset in FirstDayOfWeek .

        thanks for your read and help !!!






        Comment

        Working...
        X