-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getWeekOfYear ? #16
Comments
Is this is a request or...? |
sorry that was a little rude, Ya, I was wondering if that method was somehow implemented in your package. Or as such, set the date with a given a week of the year. Its actually a request if your answer is no lol |
Not that I know of. Can you give me an example of what it would do? Cheers. |
This is a dump of month a January 2015 by weeks following the format "d-m" $d = new ExpressiveDate();
$d->setDate(29,12,2014);
$d->getWeekOfYear(); // output 1
$d->setDate(27,1,2014);
$d->getWeekOfYear(); // output 5
//etc
//EDIT 1: I think It would be a simple
return $this->format('w');
//EDIT 2:
//In fact I need that to get the actual bi weekly number of the week,
"biweekly NUMBER IS :" . round($tmp->format("w")/2, 0, PHP_ROUND_HALF_DOWN)
//And if you feel motivated, getQuarter, get Trimester
//EDIT 3:
//What would be more interesting would be to be able to set the week and get the start date or end date of the week say
$d->setWeekOfYear(1, false); //date becomes 28-12-14
$d->setWeekOfYear(1, true); //date becomes 03-01-15 23:59:59
$d->setBiWeekOfYear(1,true);
$d->setQuarterOfYear(1,true); //4 times 3 month
$d->setTrimesterOfYear(1,true); // 3 times 4 month
//and the associated getters with each
//Last thing
$d->setDateTimeObject(\Datetime $date); //convert dateTime to Expressive I have been using your class quite extensively and those are the things were missing for me. Anyways great work man ! |
No description provided.
The text was updated successfully, but these errors were encountered: