feat: let users configure their first day of week#46592
Conversation
| 'headline' => $this->getProperty($account, IAccountManager::PROPERTY_HEADLINE), | ||
| 'biography' => $this->getProperty($account, IAccountManager::PROPERTY_BIOGRAPHY), | ||
| 'birthdate' => $this->getProperty($account, IAccountManager::PROPERTY_BIRTHDATE), | ||
| 'firstDayOfWeek' => $this->config->getUserValue($uid, 'core', 'first_day_of_week') |
Check notice
Code scanning / Psalm
PossiblyFalseArgument
1cabe94 to
7d4d200
Compare
7d4d200 to
4674699
Compare
ChristophWurst
left a comment
There was a problem hiding this comment.
Smooth 😎
I think we only need Sunday+Monday as options. Are the other days used in any culture?
| case self::USER_FIELD_FIRST_DAY_OF_WEEK: | ||
| $intValue = (int)$value; | ||
| if ($intValue < -1 || $intValue > 6) { | ||
| throw new OCSException($this->l10n->t('Invalid first day of week'), 102); |
There was a problem hiding this comment.
Just like the other properties. For some reason they all return 102 in case of invalid values 🤷♂️
artonge
left a comment
There was a problem hiding this comment.
Should we keep the "Week starts on ..." below the "Locale" setting?
I imagine this is also useful to people that do not have usual weekend days, so I would keep the full list of days. |
|
The start day is also used in the date picker. I'm not sure it can even cope with Wednesday as start day. Something to test? |
| 'headline' => $this->getProperty($account, IAccountManager::PROPERTY_HEADLINE), | ||
| 'biography' => $this->getProperty($account, IAccountManager::PROPERTY_BIOGRAPHY), | ||
| 'birthdate' => $this->getProperty($account, IAccountManager::PROPERTY_BIRTHDATE), | ||
| 'firstDayOfWeek' => $this->config->getUserValue($uid, 'core', AUserData::USER_FIELD_FIRST_DAY_OF_WEEK), |
Check notice
Code scanning / Psalm
PossiblyFalseArgument
Signed-off-by: Richard Steinmetz <[email protected]>
76ff158 to
b37fb43
Compare
There's also Friday and Saturday : https://en.wikipedia.org/wiki/Week |

Summary
The property will be propagated to the whole ecosystem via
window.firstDayand our l10n library respectively.Automatic
Overwritten
Popover open
TODO
Checklist