In some regions, monday is the first day of the week #2908

Open
opened 2025-11-02 04:53:29 -06:00 by GiteaMirror · 20 comments
Owner

Originally created by @mrvanes on GitHub (Feb 13, 2019).

Gitea version: 1.7.1, from single binary.
The high-level contribution overview starts the week at sunday. I'd prefer to make it start on monday and have sunday the bottom, as a feature-request.
image

Originally created by @mrvanes on GitHub (Feb 13, 2019). Gitea version: 1.7.1, from single binary. The high-level contribution overview starts the week at sunday. I'd prefer to make it start on monday and have sunday the bottom, as a feature-request. ![image](https://user-images.githubusercontent.com/1901782/52721242-8c387700-2fa9-11e9-9950-8a09fbdc06b6.png)
GiteaMirror added the issue/confirmedtype/enhancementtype/upstream labels 2025-11-02 04:53:29 -06:00
Author
Owner

@kolaente commented on GitHub (Mar 8, 2019):

I'd prefer to have this configurable when it gets implemented as the week starts in some countries on monday while in others on sunday.

@kolaente commented on GitHub (Mar 8, 2019): I'd prefer to have this configurable when it gets implemented as the week starts in some countries on monday while in others on sunday.
Author
Owner

@jolheiser commented on GitHub (Mar 8, 2019):

From me tinkering with this for a bit:

While the module we use allows us to change the order of the days of the week, the squares do not seem to change accordingly to match, which unfortunately means this feature may have to first happen upstream...

@jolheiser commented on GitHub (Mar 8, 2019): From me tinkering with this for a bit: While the module we use allows us to change the order of the days of the week, the squares do not seem to change accordingly to match, which unfortunately means this feature may have to first happen upstream...
Author
Owner

@stale[bot] commented on GitHub (May 7, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (May 7, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@Oreolek commented on GitHub (May 8, 2019):

So this depends on WildCodeSchool/vue-calendar-heatmap#1 right?

@Oreolek commented on GitHub (May 8, 2019): So this depends on WildCodeSchool/vue-calendar-heatmap#1 right?
Author
Owner

@kolaente commented on GitHub (May 9, 2019):

@Oreolek Yeah pretty much.

@kolaente commented on GitHub (May 9, 2019): @Oreolek Yeah pretty much.
Author
Owner

@MalcolmAnderson commented on GitHub (Dec 4, 2019):

Is any work being done on this? +1

@MalcolmAnderson commented on GitHub (Dec 4, 2019): Is any work being done on this? +1
Author
Owner

@mind-overflow commented on GitHub (Jul 2, 2020):

any update?

@mind-overflow commented on GitHub (Jul 2, 2020): any update?
Author
Owner

@lafriks commented on GitHub (Jul 18, 2020):

This depends on upstream library to add such option so this should be asked in it

@lafriks commented on GitHub (Jul 18, 2020): This depends on upstream library to add such option so this should be asked in it
Author
Owner

@noerw commented on GitHub (Dec 22, 2020):

upstream reference with a PR: https://github.com/julienr114/vue-calendar-heatmap/pull/14

@noerw commented on GitHub (Dec 22, 2020): upstream reference with a PR: https://github.com/julienr114/vue-calendar-heatmap/pull/14
Author
Owner

@molaie commented on GitHub (Sep 12, 2021):

Any chance for this feature? our start days are saturdays

@molaie commented on GitHub (Sep 12, 2021): Any chance for this feature? our start days are saturdays
Author
Owner

@rjc commented on GitHub (Feb 17, 2022):

I'd just like to point out that Monday being the first day of the week isn't just in some regions - it's international, as in ISO - the standards organization - not just ISO 8601. If anything, that should be the default and, if not, then configurable at the very least.

@rjc commented on GitHub (Feb 17, 2022): I'd just like to point out that Monday being the first day of the week isn't just in some regions - it's international, as in ISO - the standards organization - not just ISO 8601. If anything, that should be the default and, if not, then configurable at the very least.
Author
Owner

@mariuszmaximus commented on GitHub (Mar 9, 2023):

I'm waiting

@mariuszmaximus commented on GitHub (Mar 9, 2023): I'm waiting
Author
Owner

@jolheiser commented on GitHub (Mar 9, 2023):

I'm waiting

A PR would be great for this! 🙂

@jolheiser commented on GitHub (Mar 9, 2023): > I'm waiting A PR would be great for this! 🙂
Author
Owner

@bendem commented on GitHub (Mar 14, 2023):

Note that 04e97b8311 changed the library to an updated one, I opened a new issue there: https://github.com/razorness/vue3-calendar-heatmap/issues/19

@bendem commented on GitHub (Mar 14, 2023): Note that https://github.com/go-gitea/gitea/commit/04e97b83115e7439d43c0ede5fe2d1b50d201c52 changed the library to an updated one, I opened a new issue there: https://github.com/razorness/vue3-calendar-heatmap/issues/19
Author
Owner

@KazzmanK commented on GitHub (May 7, 2023):

Looks like heatmap control is abandoned one. There is a PR with fix, but still.
May be there is a reason to fork it and use updated version?

@KazzmanK commented on GitHub (May 7, 2023): Looks like heatmap control is abandoned one. There is a PR with fix, but still. May be there is a reason to fork it and use updated version?
Author
Owner

@Wohlstand commented on GitHub (Sep 1, 2023):

In some regions

I'll clarify you: in MANY regions, the more than a half of countries in the world uses Monday as a start of week. Also the fact: Bandgladesh begins week with Friday, and seven countries (United Arabic Emirates, Bahrein, Jibuty, Algir, Egypt, Marokko, Sudan) do begin a week with a... Saturday!

@Wohlstand commented on GitHub (Sep 1, 2023): > In some regions I'll clarify you: in MANY regions, the more than a half of countries in the world uses Monday as a start of week. Also the fact: Bandgladesh begins week with Friday, and seven countries (United Arabic Emirates, Bahrein, Jibuty, Algir, Egypt, Marokko, Sudan) do begin a week with a... Saturday!
Author
Owner

@serious-angel commented on GitHub (Jun 2, 2024):

I see that the commit data (i.e. "commit count" per "date"):
- 1. Gets obtained from the database and is not localized;
- 2. Later, it gets rendered on the HTML;
- 3. Passed to Vue in "user timezone" with locale-translated calendar items.

In the library used, it gets iterated through based on the data and these date items Vue prop-passed, indicating the localized day name at index 1, and starting from date at index possibly disrespecting the passed locale at all.

Considering the latter, even if it's relatively possible to get the browser's locale using Intl and/or add a definite setting in Gitea User settings for the first day of the week, it feels like a change in the library is still required. Is that correct?

Intl works indeed with a quick test:

// https://github.com/go-gitea/gitea/blob/98a61040b1c83790b0e0e977188842f967ae357e/web_src/js/utils.js#L43
function getCurrentLocale() {
  return document.documentElement.lang ?? nvagiator.language;
}

// https://github.com/go-gitea/gitea/blob/98a61040b1c83790b0e0e977188842f967ae357e/web_src/js/utils.js#L53
function translateDay(day = 0, localeCode = null) {
  const _localeCode = localeCode ?? getCurrentLocale();
  const intlLocale = Intl?.Locale ? new Intl.Locale(_localeCode) : {};
  const firstDayIndex = intlLocale?.weekInfo?.firstDay ?? 0;
  console.log(_localeCode, intlLocale, firstDayIndex);
    
  return new Date(Date.UTC(2022, 7, (day + firstDayIndex) % 7)).toLocaleString(_localeCode, {
    weekday: 'short',
    timeZone: 'UTC'
  });
}

// E.g. for 'en-US'.
translateDay(0); // 'Sun'

// 'lt' - Lithuania.
translateDay(0, 'lt'); // 'pr'
@serious-angel commented on GitHub (Jun 2, 2024): I see that the commit data (i.e. "commit count" per "date"): \- `1.` Gets [obtained](<https://github.com/go-gitea/gitea/blob/98a61040b1c83790b0e0e977188842f967ae357e/models/activities/user_heatmap.go#L66>) from the database and is not localized; \- `2.` Later, it gets [rendered](<https://github.com/go-gitea/gitea/blob/98a61040b1c83790b0e0e977188842f967ae357e/templates/user/heatmap.tmpl#L3>) on the HTML; \- `3.` [Passed](<https://github.com/go-gitea/gitea/blob/98a61040b1c83790b0e0e977188842f967ae357e/web_src/js/features/heatmap.js#L11>) to Vue in "user timezone" with [locale-translated](<https://github.com/go-gitea/gitea/blob/98a61040b1c83790b0e0e977188842f967ae357e/web_src/js/features/heatmap.js#L25>) calendar items. In the library used, it gets [iterated](<https://github.com/razorness/vue3-calendar-heatmap/blob/955626176cb5dc3d3ead8120475c2e5e753cc392/src/components/Heatmap.ts#L110>) through based on the data and these date items Vue [prop-passed](<https://github.com/razorness/vue3-calendar-heatmap/blob/955626176cb5dc3d3ead8120475c2e5e753cc392/src/components/CalendarHeatmap.vue#L270>), [indicating](<https://github.com/razorness/vue3-calendar-heatmap/blob/955626176cb5dc3d3ead8120475c2e5e753cc392/src/components/CalendarHeatmap.vue#L21>) the localized day name at index `1`, and starting from date at index possibly [disrespecting](<https://github.com/razorness/vue3-calendar-heatmap/blob/955626176cb5dc3d3ead8120475c2e5e753cc392/src/components/Heatmap.ts#L111>) the passed locale at all. Considering the latter, even if it's relatively possible to get the browser's locale using [Intl](<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo#obtaining_the_week_information>) and/or add a definite setting in Gitea User settings for the first day of the week, it feels like a change in the library is still required. Is that correct? `Intl` works indeed with a quick test: ```js // https://github.com/go-gitea/gitea/blob/98a61040b1c83790b0e0e977188842f967ae357e/web_src/js/utils.js#L43 function getCurrentLocale() { return document.documentElement.lang ?? nvagiator.language; } // https://github.com/go-gitea/gitea/blob/98a61040b1c83790b0e0e977188842f967ae357e/web_src/js/utils.js#L53 function translateDay(day = 0, localeCode = null) { const _localeCode = localeCode ?? getCurrentLocale(); const intlLocale = Intl?.Locale ? new Intl.Locale(_localeCode) : {}; const firstDayIndex = intlLocale?.weekInfo?.firstDay ?? 0; console.log(_localeCode, intlLocale, firstDayIndex); return new Date(Date.UTC(2022, 7, (day + firstDayIndex) % 7)).toLocaleString(_localeCode, { weekday: 'short', timeZone: 'UTC' }); } // E.g. for 'en-US'. translateDay(0); // 'Sun' // 'lt' - Lithuania. translateDay(0, 'lt'); // 'pr' ```
Author
Owner

@rmatab commented on GitHub (Jan 28, 2025):

Looks like heatmap control is abandoned one. There is a PR with fix, but still. May be there is a reason to fork it and use updated version?

Last updated six years ago:

https://www.npmjs.com/package/vue-calendar-heatmap

Looks like we are waiting on someone with Vue expertise that is willing to maintain a fork or negotiate a transfer of ownership.

@rmatab commented on GitHub (Jan 28, 2025): > Looks like heatmap control is abandoned one. There is a PR with fix, but still. May be there is a reason to fork it and use updated version? Last updated six years ago: https://www.npmjs.com/package/vue-calendar-heatmap Looks like we are waiting on someone with Vue expertise that is willing to maintain a fork or negotiate a transfer of ownership.
Author
Owner

@bendem commented on GitHub (Jan 28, 2025):

Last updated six years ago:

https://www.npmjs.com/package/vue-calendar-heatmap

Wrong one, the library was updated, it's https://www.npmjs.com/package/vue3-calendar-heatmap, last updated 2 years ago still.

Nvm, it's https://www.npmjs.com/package/@silverwind/vue3-calendar-heatmap since eb8bb82e58, which looks like a fork that adds tippyprops.

@bendem commented on GitHub (Jan 28, 2025): > Last updated six years ago: > > https://www.npmjs.com/package/vue-calendar-heatmap ~~Wrong one, the library was updated, it's https://www.npmjs.com/package/vue3-calendar-heatmap, last updated 2 years ago still.~~ Nvm, it's https://www.npmjs.com/package/@silverwind/vue3-calendar-heatmap since https://github.com/go-gitea/gitea/commit/eb8bb82e584f0d0cb91ebc0e37e40c53da729ce8, which looks like a fork that adds tippyprops.
Author
Owner

@Duviri commented on GitHub (Jul 23, 2025):

a setting for this, even if its editing some line in a file somewhere and not a complete UI integration would be awesome <3

@Duviri commented on GitHub (Jul 23, 2025): a setting for this, even if its editing some line in a file somewhere and not a complete UI integration would be awesome <3
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2908