Skip to content
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

Open
collmomo opened this issue Jan 26, 2015 · 4 comments
Open

getWeekOfYear ? #16

collmomo opened this issue Jan 26, 2015 · 4 comments

Comments

@collmomo
Copy link

No description provided.

@jasonlewis
Copy link
Owner

Is this is a request or...?

@collmomo
Copy link
Author

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

@jasonlewis
Copy link
Owner

Not that I know of. Can you give me an example of what it would do? Cheers.

@collmomo
Copy link
Author

AppController.php on line 31:
"28-12"
AppController.php on line 34:
"04-01"
AppController.php on line 36:
"11-01"
AppController.php on line 38:
"18-01"
AppController.php on line 40:
"25-01"
AppController.php on line 34:
"01-02"

This is a dump of month a January 2015 by weeks following the format "d-m"
Example of application:

 $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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants