#22549 [Opn->Asn]: Date/Calc.php, beginOfWeek() fails, easier implementations

From: Date: Mon, 28 Apr 2003 09:05:20 +0000
Subject: #22549 [Opn->Asn]: Date/Calc.php, beginOfWeek() fails, easier implementations
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-15669@lists.php.net to get a copy of this message
ID: 22549 Updated by: arnaud@php.net Reported By: andreas dot kossmeier at bergfex dot at -Status: Open +Status: Assigned Bug Type: PEAR related Operating System: Debian Linux PHP Version: 4.3.1 -Assigned To: +Assigned To: pajoye New Comment: IIRC pierre like Date :) Previous Comments: ------------------------------------------------------------------------ [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

« previous php.pear.dev (#15669) next »