rails/rails — pull request #5339 by gregolsen (2012-03-08 12:52:01+00:00)
Title: week_start option added to rails app config

Few months ago my PR #3547 was accepted.
Ever since I was thinking about adding `week_start` option to rails app config.
Last comments on PR #3547 pushed me to come up with this PR.

Here `config.week_start` option added, `beginning_of_week`, `end_of_week` and other methods updated to use `Date.week_start` as default.
`Date.week_start` can be set via config or using `Date.week_start=` for current request\thread (mimics time zone).
Method `sunday` (`monday`) updated to always return Sunday (Monday) to avoid possible confusion.

`next_week` and `prev_week` updated the same way, but they can be modified to work correctly even if `week_start` is not `:monday`.
If feedback to this PR will be positive I can update them along with the API docs.