support custom first day of week

This commit is contained in:
MaysWind
2021-01-31 20:09:03 +08:00
parent e06fba3f8b
commit 61267af634
15 changed files with 262 additions and 81 deletions
+2
View File
@@ -64,6 +64,7 @@ import {
resetState,
currentUserNickname,
currentUserDefaultCurrency,
currentUserFirstDayOfWeek,
} from './user.js';
import {
@@ -191,6 +192,7 @@ const stores = {
// user
currentUserNickname,
currentUserDefaultCurrency,
currentUserFirstDayOfWeek,
// exchange rates
exchangeRatesLastUpdateDate,
+9 -2
View File
@@ -133,7 +133,8 @@ export function register(context, { user }) {
password: user.password,
email: user.email,
nickname: user.nickname,
defaultCurrency: user.defaultCurrency
defaultCurrency: user.defaultCurrency,
firstDayOfWeek: user.firstDayOfWeek
}).then(response => {
const data = response.data;
@@ -234,7 +235,8 @@ export function updateUserProfile(context, { profile, currentPassword }) {
oldPassword: currentPassword,
email: profile.email,
nickname: profile.nickname,
defaultCurrency: profile.defaultCurrency
defaultCurrency: profile.defaultCurrency,
firstDayOfWeek: profile.firstDayOfWeek
}).then(response => {
const data = response.data;
@@ -342,3 +344,8 @@ export function currentUserDefaultCurrency(state) {
const userInfo = state.currentUserInfo || {};
return userInfo.defaultCurrency || null;
}
export function currentUserFirstDayOfWeek(state) {
const userInfo = state.currentUserInfo || {};
return utils.isNumber(userInfo.firstDayOfWeek) ? userInfo.firstDayOfWeek : null;
}