You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2003/06/16 20:15:52 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/dv/xs AbstractDateTimeDV.java

sandygao    2003/06/16 11:15:52

  Modified:    java/src/org/apache/xerces/impl/dv/xs
                        AbstractDateTimeDV.java
  Log:
  E2-41 and E2-45: allowing 24:00:00.
  
  Revision  Changes    Path
  1.12      +15 -2     xml-xerces/java/src/org/apache/xerces/impl/dv/xs/AbstractDateTimeDV.java
  
  Index: AbstractDateTimeDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/AbstractDateTimeDV.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- AbstractDateTimeDV.java	2 Apr 2003 14:12:00 -0000	1.11
  +++ AbstractDateTimeDV.java	16 Jun 2003 18:15:51 -0000	1.12
  @@ -434,7 +434,20 @@
   
           //validate hours
           if ( data[h]>23 || data[h]<0 ) {
  -            throw new RuntimeException("Hour must have values 0-23");
  +            if (data[h] == 24 && data[m] == 0 && data[s] == 0 && data[ms] == 0) {
  +                data[h] = 0;
  +                if (++data[D] > maxDayInMonthFor(data[CY], data[M])) {
  +                    data[D] = 1;
  +                    if (++data[M] > 12) {
  +                        data[M] = 1;
  +                        if (++data[CY] == 0)
  +                            data[CY] = 1;
  +                    }
  +                }
  +            }
  +            else {
  +                throw new RuntimeException("Hour must have values 0-23, unless 24:00:00");
  +            }
           }
   
           //validate
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org