mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-04-13 10:56:05 +00:00
Fixed setting moment.js locale to user-defined language
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
e79b7e962d
commit
ce469b1e2d
2 changed files with 7 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
/* eslint-env browser, jquery */
|
||||
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
|
||||
/* global moment, serverurl */
|
||||
/* global moment, serverurl, Cookies */
|
||||
|
||||
import Prism from 'prismjs'
|
||||
import hljs from 'highlight.js'
|
||||
|
@ -31,6 +31,11 @@ require('../vendor/md-toc')
|
|||
var Viz = require('viz.js')
|
||||
const ui = getUIElements()
|
||||
|
||||
if (Cookies.get('locale')) {
|
||||
const lang = Cookies.get('locale')
|
||||
moment.locale(lang)
|
||||
}
|
||||
|
||||
// auto update last change
|
||||
window.createtime = null
|
||||
window.lastchangetime = null
|
||||
|
|
|
@ -21,6 +21,7 @@ if (Cookies.get('locale')) {
|
|||
}
|
||||
|
||||
locale.val(lang)
|
||||
window.moment.locale(lang)
|
||||
$('select.ui-locale option[value="' + lang + '"]').attr('selected', 'selected')
|
||||
|
||||
locale.change(function () {
|
||||
|
|
Loading…
Add table
Reference in a new issue