mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
set instance_timezone before
This commit is contained in:
parent
3c59e8cc66
commit
e0342b0dd7
2 changed files with 3 additions and 1 deletions
|
@ -3,6 +3,8 @@ const settingsController = require('./api/controller/settings')
|
|||
const acceptLanguage = require('accept-language')
|
||||
const express = require('express')
|
||||
const dayjs = require('dayjs')
|
||||
const timezone = require('dayjs/plugin/timezone')
|
||||
dayjs.extend(timezone)
|
||||
|
||||
const config = require('./config')
|
||||
const log = require('./log')
|
||||
|
@ -81,6 +83,7 @@ module.exports = {
|
|||
res.locals.settings.version = pkg.version
|
||||
// set user locale
|
||||
res.locals.user_locale = settingsController.user_locale[res.locals.acceptedLocale]
|
||||
dayjs.tz.setDefault(res.locals.settings.instance_timezone)
|
||||
next()
|
||||
},
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ export const actions = {
|
|||
// we use it to get configuration from db, set locale, etc...
|
||||
nuxtServerInit ({ commit }, { _req, res }) {
|
||||
commit('setSettings', res.locals.settings)
|
||||
dayjs.tz(res.locals.settings.instance_timezone)
|
||||
if (res.locals.status === 'READY') {
|
||||
commit('setAnnouncements', res.locals.announcements)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue