Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext GWT Premium Member
    Join Date
    Jun 2009
    Posts
    70
    Vote Rating
    0
    zdarsky is on a distinguished road

      0  

    Exclamation [FNR-27] TimeField Error when set time 23:45

    [FNR-27] TimeField Error when set time 23:45


    Hi,

    we use GWT 1.7.0 and GXT 2.0.4


    There is a bug in TimeField.findModel(Date date)
    If a time is 23:45 it returns null instead of Time instance with value (11:45 PM)
    The problem is here (see comments):
    Code:
          if (t2 == null) {
            DateWrapper temp = new DateWrapper();
            temp = temp.clearTime();
            temp = temp.addMinutes(t1.getMinutes() + increment);
            temp = temp.addHours(t1.getHour()); //creates a full datetime holding 00:00 of the next day
            t2 = new Time(temp.asDate()); //throws away the date part, holding only 00:00 the same day 
          }
          long l1 = t1.getDate().getTime();
          long l2 = t2.getDate().getTime();
     
          if (l >= l1 && l < l2) { // check fails, because l2 is smaller then l (23:45 > 00:00)
            return t1;
          }

  2. #2
    Ext User
    Join Date
    Jan 2010
    Posts
    24
    Vote Rating
    0
    SopGreg is on a distinguished road

      0  

    Default


    I can confirm this, please provide a quick fix, something like this:

    Code:
    long l1 = t1.getDate().getTime();
    Long l2 = null;
    
    if (t2 == null) {
       DateWrapper temp = new DateWrapper();
       temp = temp.clearTime();
       temp = temp.addMinutes(t1.getMinutes() + increment);
       temp = temp.addHours(t1.getHour());
       l2 = temp.asDate.getTime(); 
    }
    else {
       l2 = t2.getDate().getTime();
    }
    regards

  3. #3
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Fixed in SVN as of revision 1963

  4. #4
    Ext User
    Join Date
    Mar 2009
    Posts
    72
    Vote Rating
    0
    jtyrrell is on a distinguished road

      0  

    Default Still happening in 2.1.2

    Still happening in 2.1.2


    This is still occurring in 2.1.2.

    Set the time to to 23:45 (or 11:45PM) and nothing is displayed, select 23:45 (or 11:45PM) and nothing is displayed.

  5. #5
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    FNR means fix not released. This fix was not part of GXT 2.1.2. 2.1.2 got released of SVN revision 1957. The fix got commited at revision 1963.

Thread Participants: 3