#22549 [Asn->Csd]: Date/Calc.php, beginOfWeek() fails, easier implementations
| From: | pajoye@php.net | Date: | Sun, 25 May 2003 19:47:19 +0000 |
| Subject: | #22549 [Asn->Csd]: Date/Calc.php, beginOfWeek() fails, easier implementations | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16689@lists.php.net to get a copy of this message | ||
ID: 22549
Updated by: pajoye@php.net
Reported By: andreas dot kossmeier at bergfex dot at
-Status: Assigned
+Status: Closed
Bug Type: PEAR related
Operating System: Debian Linux
PHP Version: 4.3.1
Assigned To: pajoye
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2003-04-28 04:05:20] arnaud@php.net
IIRC pierre like Date :)
------------------------------------------------------------------------
[2003-04-27 15:51:21] lsmith@php.net
ok I have just confirmed the bugs and that the diff seems to work.
However because this date handling is constantly confusing me I rather
put up my test script for now.
http://www.backendmedia.com/Date/Calc_new.phps
http://www.backendmedia.com/Date/dayofweek_test.phps
------------------------------------------------------------------------
[2003-03-31 09:33:49] andreas dot kossmeier at bergfex dot at
correction:
errors only occure if DATE_CALC_BEGIN_WEEKDAY is 1 (default)
------------------------------------------------------------------------
[2003-03-31 09:31:45] andreas dot kossmeier at bergfex dot at
errors only occure if DATE_CALC_BEGIN_WEEKDAY is 0 (default: 1):
20030317 Monday:
endOfWeek() CVS: 20030323 fixed: 20030323
beginOfWeek() CVS: 20030317 fixed: 20030317
beginOfNextWeek() CVS: 20030324 fixed: 20030324
beginOfPrevWeek() CVS: 20030310 fixed: 20030310
20030320 Thursday:
endOfWeek() CVS: 20030323 fixed: 20030323
beginOfWeek() CVS: 20030317 fixed: 20030317
beginOfNextWeek() CVS: 20030324 fixed: 20030324
beginOfPrevWeek() CVS: 20030310 fixed: 20030310
20030323 Sunday:
endOfWeek() CVS: 20030330 fixed: 20030323
beginOfWeek() CVS: 20030317 fixed: 20030317
beginOfNextWeek() CVS: 20030331 fixed: 20030324
beginOfPrevWeek() CVS: 20030317 fixed: 20030310
------------------------------------------------------------------------
[2003-03-05 07:35:53] andreas dot kossmeier at bergfex dot at
Date/Calc.php
this bug report describes various bugs and issues for calculating begin
and end of week (including implementation of beginOfNextWeek and
beginOfPreviousWeek)
- endOfWeek()
fails, if date *is* end of the week
- beginOfWeek()
much easier implementation (1 vs. 11 lines of code)
- beginOfNextWeek(), beginOfPreviousWeek()
failing, if date is end of the week
both functions use their own implementation for getting the beginning
of a week, but *should* use Date_Calc::beginOfWeek()
A diff (including fix for Bug #22548) to CVS Version 1.9 is available
at http://bergfex.at/php/pear/Calc.php.diff.txt
Andreas Kossmeier
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22549&edit=1