#22549 [Opn]: Date/Calc.php, beginOfWeek() fails, easier implementations
| From: | andreas dot kossmeier at bergfex dot at | Date: | Mon, 31 Mar 2003 15:31:46 +0000 |
| Subject: | #22549 [Opn]: Date/Calc.php, beginOfWeek() fails, easier implementations | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-14733@lists.php.net to get a copy of this message | ||
ID: 22549
User updated by: andreas dot kossmeier at bergfex dot at
-Reported By: koan at gmx dot at
+Reported By: andreas dot kossmeier at bergfex dot at
Status: Open
Bug Type: PEAR related
Operating System: Debian Linux
PHP Version: 4.3.1
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[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