Skip to content
Permalink
Browse files

date lang fixes

  • Loading branch information...
Manuel-777 committed May 19, 2019
1 parent cb1696d commit 60d6d33b12a373669c21e18d6a021a1df8074612
Showing with 10 additions and 10 deletions.
  1. +9 −9 window_background/background-util.js
  2. +1 −1 window_background/labels.js
@@ -17,14 +17,14 @@ function parseWotcTime(str) {
// https://date-fns.org/v2.0.0-alpha.7/docs/parse
let dateLangs = {
English: "M/d/YYYY h:MM:SS A", // ex: 5/19/2019 11:08:01 AM
German: "DD.MM.YYYY HH:MM:SS", // ex: 19.05.2019 09:59:00
French: "DD/MM/YYYY HH:MM:SS", //ex: 19/05/2019 10:39:42
Italian: "DD/MM/YYYY HH:MM:SS", //ex: 19/05/2019 10:43:03
Japanese: "YYYY/MM/DD HH:MM:SS", //ex: 2019/05/19 10:45:04
Korean: "YYYY-MM-DD A HH:MM:SS", //ex: 2019-05-19 AM 10:56:27
"Portugese (Brazil)": "DD/MM/YYYY HH:MM:SS", //ex: 19/05/2019 11:02:32
Russian: "DD.MM.YYYY HH:MM:SS", //ex: 19.05.2019 11:05:15
Spanish: "DD/MM/YYYY HH:MM:SS" //ex:19/05/2019 11:06:37
German: "DD.MM.YYYY hh:mm:ss", // ex: 19.05.2019 09:59:00
French: "DD/MM/YYYY hh:mm:ss", //ex: 19/05/2019 10:39:42
Italian: "DD/MM/YYYY hh:mm:ss", //ex: 19/05/2019 10:43:03
Japanese: "YYYY/MM/DD hh:mm:ss", //ex: 2019/05/19 10:45:04
Korean: "YYYY-MM-DD A hh:mm:ss", //ex: 2019-05-19 AM 10:56:27
"Portugese (Brazil)": "DD/MM/YYYY hh:mm:ss", //ex: 19/05/2019 11:02:32
Russian: "DD.MM.YYYY hh:mm:ss", //ex: 19.05.2019 11:05:15
Spanish: "DD/MM/YYYY hh:mm:ss" //ex: 19/05/2019 11:06:37
};

// throws an error if it fails
@@ -36,7 +36,7 @@ function parseWotcTime2(dateStr) {
if (!date || isNaN(date.getTime())) {
date = new Date();
Object.keys(dateLangs).forEach(lang => {
let test = parse(dateStr, dateLangs[logLanguage], new Date());
let test = parse(dateStr, dateLangs[lang], new Date());
if (test && !isNaN(test.getTime())) {
logLanguage = lang;
console.log(`Log datetime language detected: ${lang}`);
@@ -4,7 +4,7 @@ function onLabelOutLogInfo(entry, json) {
if (!json) return;

if (json.params.messageName == "Client.Connected") {
logLanguage = json.params.payloadObject.settings.language;
logLanguage = json.params.payloadObject.settings.language.language;
}
if (skipMatch) return;
if (json.params.messageName == "DuelScene.GameStop") {

0 comments on commit 60d6d33

Please sign in to comment.
You can’t perform that action at this time.