fixed problem with day-of-week-in-month (bug 157592) with patch from Sal
authorWilliam M. Brack <wbrack@src.gnome.org>
Mon, 8 Nov 2004 03:41:26 +0000 (03:41 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Mon, 8 Nov 2004 03:41:26 +0000 (03:41 +0000)
* libexslt/date.c: fixed problem with day-of-week-in-month
  (bug 157592) with patch from Sal Paradise
* tests/exslt/date/datetime.1.out: corrected expected output
  after above fix

ChangeLog
libexslt/date.c
tests/exslt/date/datetime.1.out

index ece0fbb..6fc464a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Mon Nov  8 11:41:32 HKT 2004 William Brack <wbrack@mmm.com.hk>
+
+       * libexslt/date.c: fixed problem with day-of-week-in-month
+         (bug 157592) with patch from Sal Paradise
+       * tests/exslt/date/datetime.1.out: corrected expected output
+         after above fix
+
 Mon Nov  1 15:57:24 CET 2004 Daniel Veillard <daniel@veillard.com>
 
        * tests/general/bug-155.*, tests/general/Makefile.am,
index 1f4cc25..641fde3 100644 (file)
@@ -2203,7 +2203,7 @@ exsltDateWeekInMonth (const xmlChar *dateTime)
      */
     fdiw = (_exsltDateDayInWeek(fdiy, dt->value.date.year) + 6) % 7;
 
-    ret = ((dt->value.date.day + fdiw) / 7) + 1;
+    ret = ((dt->value.date.day + fdiw - 1) / 7) + 1;
 
     exsltDateFreeDate(dt);
 
@@ -2348,7 +2348,7 @@ exsltDateDayOfWeekInMonth (const xmlChar *dateTime)
        }
     }
 
-    ret = (dt->value.date.day / 7) + 1;
+    ret = ((dt->value.date.day -1) / 7) + 1;
 
     exsltDateFreeDate(dt);
 
index 7ea9826..ca0996c 100644 (file)
@@ -10,7 +10,7 @@
     week-in-year         : 9
     day-in-year          : 59
     day-in-month         : 28
-    day-of-week-in-month : 5
+    day-of-week-in-month : 4
     day-in-week          : 4
     day-name             : Wednesday
     day-abbreviation     : Wed