makzumi / laravel-calendar

Flexible Calendar for Laravel 4
58 stars 31 forks source link

Starting the week on Monday #15

Open matthieucalu opened 10 years ago

matthieucalu commented 10 years ago

In Europe calendars start the week on Monday instead of Sunday. Is it possible to choose this? If not, which part of the code should I look at to change this?

rginnow commented 10 years ago

I believe this is a PHP option itself. If you set it in your php.ini (or somewhere like that) if you echo day[0] it may come out as monday. Search around google and i'm sure you'll find an option for that somewhere.

makzumi commented 10 years ago

Hi, I have not set a method for a start day, I didnt event think of it, I'll add that as soon as i can. :)

makzumi commented 10 years ago

And sorry, i didnt even notice this issue was open, i didnt get notified

ronnievisser commented 9 years ago

When will this be fixed?

urbankid commented 9 years ago

I'm also interested in finding a solution to start the week on Monday!

kremsy commented 9 years ago

Im using your great plugin since today and for my project I would really need that the week starts on monday!

davidgras commented 9 years ago

Hi! github-newbie here, with newbie doubts. I need that feature working whithin a pair of weeks maximum, so I was thinking to develop by myself but I've found out that it's already done on several related forked projects. What should I do? Why that projects haven't done a pull request of this feature? How things are done around here? Thanks ^^

makzumi commented 9 years ago

Hi Folks! I'm real sorry I havent been able to update this thing, I've been buried in other projects for weeks now :S I can't really update this right now, maybe after x-mas, sooo sorry :(

davidgras commented 9 years ago

Don't worry makzumi, take it easy ;)

I just want to understand what's the best behaviour for the community, for the owner:

rginnow commented 9 years ago

David,

If you have seen it done in other projects and can find out where its done in their code, fork Makzumi's project and fix it for him. Then do a pull request with his and your code and github will show the differences and all you do is describe the change you made. Makzumi can then accept or deny your pull request. Be aware that I will check to make sure your fix does actually work. If makzumi hasn't had the time, I'm going to help and try to fix this myself as well.

Makzumi, if you would like help, I will gladly dedicate some time to these issues.

davidgras commented 9 years ago

Understood, it seems very neat! Thank you and sorry for the off-topic.

rginnow commented 9 years ago

@davidgras No problem, if you are new to Git, I recommend finding tutorials either by Github, Bitbucket or elsewhere around the internet.

As for this project, I'm looking into a fix for this now.

kazrusm commented 9 years ago

I decided this issue. We must go to vendor/..../Calendar.php In the function buildBody(), after this row:

$startingDay = date('N', strtotime('first day of this month', strtotime($now_date)));

we must add:

$startingDay = $startingDay - 1;

Before generate calendar, we must rename array elements in setDayLabels

Donny5300 commented 9 years ago

@kazrusm this is only for month view, not for the week view?