Closed Bug 796616 Opened 13 years ago Closed 12 years ago

[calendar] change the starting day of the week

Categories

(Firefox OS Graveyard :: Gaia::Calendar, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 823133

People

(Reporter: ghtobz, Unassigned)

References

Details

(Whiteboard: [label:settings][label:UX][label:calendar])

[GitHub issue by beatrizrodriguez on 2012-09-10T15:03:40Z, https://github.com/mozilla-b2g/gaia/issues/4509] In some countries we are used to weeks that start on Monday instead of Sunday. We need to have this setting inside calendar-view. Current implementation only has Sunday as the first day of the week.
[GitHub comment by nhirata on 2012-09-11T23:25:46Z] @caseyyee @lightsofapollo
[GitHub comment by lightsofapollo on 2012-09-12T03:01:01Z] The way it should work now is based on the locale (as gecko see's it) that is the start of the week. We use Date#getDay to find which day of the week is which. There is no code that specifically states 0 is Monday. On the other hand we do not offer any option to switch the starting day of week outside of what Date & gecko offer and it would be a medium effort to support doing. I _think_ binding this to the locale will provide for the majority of users. If you set to en-US (as is the default) your going to get Sun,Mon, etc... other locales should see what is relevant for them. On Tue, Sep 11, 2012 at 4:25 PM, Naoki Hirata <notifications@github.com>wrote: > @caseyyee <https://github.com/caseyyee> @lightsofapollo<https://github.com/lightsofapollo> > > — > Reply to this email directly or view it on GitHub<https://github.com/mozilla-b2g/gaia/issues/4509#issuecomment-8476336>. > >
[GitHub comment by lightsofapollo on 2012-09-18T22:53:32Z] @fabi1cazenave I think the better way to solve this instead of relying on what the JS engine does is maybe to add this directly to our localization files. This is the way lightning does it so something like: ```` weekday-0-position = 6 weekday-1-position = 0 weekday-2-position = 1 weekday-3-position = 2 weekday-4-position = 3 weekday-5-position = 4 weekday-6-position = 5 ```` To map the first day of the week to Monday and the last to Sunday? If you find the acceptable I will work on the patch for this. This locale information is also already in Lightning so we can steal it mostly as is.
[GitHub comment by fabi1cazenave on 2012-09-19T03:01:11Z] @lightsofapollo I like this idea! Of course it makes a lot of sense in the Calendar app, but it could be applied to the `shared/locales/date` as well in order to ensure this will be consistent across all apps.
[GitHub comment by caseyyee on 2012-09-19T17:47:03Z] cc @RudyLu As a note, this same logic would need to be applied to the date pickers as well.
[GitHub comment by lightsofapollo on 2012-09-19T18:07:20Z] I should be able to work on this next week and I can port over the work to the date picker as well. The majority of the calculation code is identical to the date picker code. On Wed, Sep 19, 2012 at 10:47 AM, Casey Yee <notifications@github.com>wrote: > cc @RudyLu <https://github.com/RudyLu> > As a note, this same logic would need to be applied to the date pickers as > well. > > — > Reply to this email directly or view it on GitHub<https://github.com/mozilla-b2g/gaia/issues/4509#issuecomment-8699723>. > >
Component: Gaia → Gaia::Calendar
What's the start of the day of the week in Brazil?
(In reply to Jason Smith [:jsmith] from comment #7) > What's the start of the day of the week in Brazil? It is Sunday
Proposing a tentative patch in pull request: https://github.com/mozilla-b2g/gaia/pull/7298 As far as I've tested: - correct monday start of week in french locale - correct sunday start of week in english/us locale
There are also countries/regions who use days different than Sunday and Monday for the first day of the week, e.g. the Mid East. See the bottom of https://en.wikipedia.org/wiki/Seven-day_week#Week_numbering
This is actually already fixed but you might need to update the greek locale file... Also I don't think start of the week changes right now until the calendar is restarted or moved a week or more into the future (so if you go from en-US to greek while the calendar is running it may not change immediately)
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.