derick          Tue Aug  5 18:03:47 2008 UTC

  Added files:                 (Branch: PHP_5_3)
    /php-src/ext/date/tests     date_period.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/date/lib       tm2unixtime.c 
  Log:
  - MFH: Fixed a bug that caused miscalculations with the "last <weekday> of <n>
    month" relative time string.
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.247&r2=1.2027.2.547.2.965.2.248&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.247 
php-src/NEWS:1.2027.2.547.2.965.2.248
--- php-src/NEWS:1.2027.2.547.2.965.2.247       Mon Aug  4 07:20:14 2008
+++ php-src/NEWS        Tue Aug  5 18:03:46 2008
@@ -2,6 +2,8 @@
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 200?, PHP 5.3.0 Alpha 2
 - Removed shebang line check from CGI sapi (it is checked by scanner) (Dmitry)
+- Fixed a bug that caused miscalculations with the "last <weekday> of <n>
+  month" relative time string. (Derick)
 
 - Fixed bug #45696 (Not all DateTime methods allow method chaining). (Derick)
 - Fixed bug #45545 (DateInterval has a limitation of 4 chars for ISO
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/tm2unixtime.c?r1=1.13.2.3.2.2.2.10&r2=1.13.2.3.2.2.2.11&diff_format=u
Index: php-src/ext/date/lib/tm2unixtime.c
diff -u php-src/ext/date/lib/tm2unixtime.c:1.13.2.3.2.2.2.10 
php-src/ext/date/lib/tm2unixtime.c:1.13.2.3.2.2.2.11
--- php-src/ext/date/lib/tm2unixtime.c:1.13.2.3.2.2.2.10        Tue Jul  8 
17:55:59 2008
+++ php-src/ext/date/lib/tm2unixtime.c  Tue Aug  5 18:03:47 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: tm2unixtime.c,v 1.13.2.3.2.2.2.10 2008/07/08 17:55:59 derick Exp $ */
+/* $Id: tm2unixtime.c,v 1.13.2.3.2.2.2.11 2008/08/05 18:03:47 derick Exp $ */
 
 #include "timelib.h"
 
@@ -277,6 +277,7 @@
                                break;
                }
        }
+       do_normalize(time);
 }
 
 static timelib_sll do_years(timelib_sll year)

http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/date_period.phpt?view=markup&rev=1.1
Index: php-src/ext/date/tests/date_period.phpt
+++ php-src/ext/date/tests/date_period.phpt
--TEST--
DatePeriod
--INI--
date.timezone=UTC
--FILE--
<?php
$db = new DateTime( '2008-01-01' );
$de = new DateTime( '2008-12-31' );
$di = DateInterval::createFromDateString( 'first day of next month' );

foreach ( new DatePeriod( $db, $di, $de ) as $dt )
{
    echo $dt->modify( "3 tuesday" )->format( "l Y-m-d\n" );
}
?>

<?php
$db = new DateTime( '2007-12-31' );
$de = new DateTime( '2009-12-31 23:59:59' );
$di = DateInterval::createFromDateString( 'last thursday of next month' );

foreach ( new DatePeriod( $db, $di, $de, DatePeriod::EXCLUDE_START_DATE ) as 
$dt )
{
    echo $dt->format( "l Y-m-d H:i:s\n" );
}
?>
--EXPECT--
Tuesday 2008-01-15
Tuesday 2008-02-19
Tuesday 2008-03-18
Tuesday 2008-04-15
Tuesday 2008-05-20
Tuesday 2008-06-17
Tuesday 2008-07-15
Tuesday 2008-08-19
Tuesday 2008-09-16
Tuesday 2008-10-21
Tuesday 2008-11-18
Tuesday 2008-12-16

Thursday 2008-01-31 00:00:00
Thursday 2008-02-28 00:00:00
Thursday 2008-03-27 00:00:00
Thursday 2008-04-24 00:00:00
Thursday 2008-05-29 00:00:00
Thursday 2008-06-26 00:00:00
Thursday 2008-07-31 00:00:00
Thursday 2008-08-28 00:00:00
Thursday 2008-09-25 00:00:00
Thursday 2008-10-30 00:00:00
Thursday 2008-11-27 00:00:00
Thursday 2008-12-25 00:00:00
Thursday 2009-01-29 00:00:00
Thursday 2009-02-26 00:00:00
Thursday 2009-03-26 00:00:00
Thursday 2009-04-30 00:00:00
Thursday 2009-05-28 00:00:00
Thursday 2009-06-25 00:00:00
Thursday 2009-07-30 00:00:00
Thursday 2009-08-27 00:00:00
Thursday 2009-09-24 00:00:00
Thursday 2009-10-29 00:00:00
Thursday 2009-11-26 00:00:00
Thursday 2009-12-31 00:00:00



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to