-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
In some regions, monday is the first day of the week #6058
Comments
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. |
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... |
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. |
So this depends on julienr114/vue-calendar-heatmap#1 right? |
@Oreolek Yeah pretty much. |
Is any work being done on this? +1 |
any update? |
This depends on upstream library to add such option so this should be asked in it |
upstream reference with a PR: julienr114/vue-calendar-heatmap#14 |
Any chance for this feature? our start days are saturdays |
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. |
I'm waiting |
A PR would be great for this! 🙂 |
Note that 04e97b8 changed the library to an updated one, I opened a new issue there: razorness/vue3-calendar-heatmap#19 |
Looks like heatmap control is abandoned one. There is a PR with fix, but still. |
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! |
I see that the commit data (i.e. "commit count" per "date"): 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 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?
// 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' |
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.
The text was updated successfully, but these errors were encountered: