Re: PEAR::Calendar: Can you build a week with only the year and the week number
| From: | Lorenzo Alberton | Date: | Fri, 23 Jul 2004 08:36:01 +0000 |
| Subject: | Re: PEAR::Calendar: Can you build a week with only the year and the week number | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-13823@lists.php.net to get a copy of this message | ||
On Thu, 22 Jul 2004 16:03:08 +0200, Peter Monsson wrote:
> Hi all,
>
> From the documentation I can't see whether it's possible to build a
> specific week just from the year and the week number. Ideally I'd
> like to build the week like this
>
> $Week = new Calendar_Week($year, $weeknumber, 'n_in_year');
>
> but that's not possible (yet) so I'm wondering whether there is an
> other way to achieve the same result without having to iterate
> through the whole year.
Hi,
sorry, but that's not possible yet.
You have to iterate, but you'll probably find the getWeekNInYear()
method of the Calendar Engine useful for your comparisons.
You need to do a comparison every 7 days, until the match is reached.
HTH
Regards,
--
Lorenzo Alberton
http://pear.php.net/user/quipo