Re: Problem with Calendar php package from PEAR: Days are skewed one day early
| From: | Jared Farrish | Date: | Sat, 11 Nov 2006 01:31:32 +0000 |
| Subject: | Re: Problem with Calendar php package from PEAR: Days are skewed one day early | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25765@lists.php.net to get a copy of this message | ||
Brett,
Thank you, that worked perfect! Adding the zero to the constructor made it
work as expected.
Thank you!
Jared
On 11/10/06, Brett Bieber <brett.bieber@gmail.com> wrote:
On 11/10/06, Jared Farrish <farrishj@gmail.com> wrote: Good Morning! I am working on a calendar scheduling program that runs in PHP, and I am having a problem with the Calendar package (v1.4) from the PEAR repository. Would you mind taking a look at the code to see if I've done something wrong? I have run this on a development machine that is separate from our network and experienced the same problem (all days are one day earlier, meaning today is represented as the 11th of November). I have also been digging through the Calendar package to see if there's something that might clue me in, and so far I haven't figured out what's wrong. Here's the link to the calendar script output: https://web2.unt.edu/riskman/Includes/rmes_oncallfiresafety.inc.php And here's the link to the calendar code behind: https://web2.unt.edu/riskman/Includes/rmes_oncallfiresafety.inc.php?html=true I hope someone can help me figure out what's wrong. I just can't understand why it's giving me the wrong date/day of the week combination. Have you tried: $Month = new Calendar_Month_Weekdays($gety,$getm,0); It looks like you're making some assumptions about the day you want your week to start and applying day headers to the wrong columns. You can specify the day you want your week to start in the constructor, see the docs for more details (specifially the $firstDay parameter). http://pear.php.net/manual/en/package.datetime.calendar.calendar-month-weekdays.calendar-month-weekdays.php -- -Brett http:saltybeagle.com aim:ianswerq-- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$