Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Grasscutter
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
ziqian zhang
Grasscutter
Commits
b852f384
Commit
b852f384
authored
3 years ago
by
Hotaru
Committed by
Melledy
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix broken time formatting on gacha records
parent
92b103d5
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
data/gacha_records.html
+4
-57
4 additions, 57 deletions
data/gacha_records.html
with
4 additions
and
57 deletions
data/gacha_records.html
+
4
−
57
View file @
b852f384
...
@@ -53,47 +53,14 @@
...
@@ -53,47 +53,14 @@
}
}
</style>
</style>
<title>
Gacha Records
</title>
<title>
Gacha Records
</title>
<script>
// Debug entry
// record = [
// {"time": 10000341, "item": 1041},
// {"time": 10000342, "item": 1032},
// {"time": 10000343, "item": 1035},
// ];
// maxPage = 5;
// in production environment
record
=
{{
REPLACE_RECORD
}};
maxPage
=
{{
REPLACE_MAXPAGE
}};
// TODO: implement this mapper by yourself
// I don't want to put real items' name here to avoid being DMCA'd
mappings
=
{
'
en-us
'
:
{
200
:
"
Standard
"
,
301
:
"
Event Avatar
"
,
302
:
"
Event Weapon
"
,
1041
:
[
"
M0n4
"
,
"
blue
"
],
1032
:
[
"
B4nn477
"
,
"
purple
"
],
1035
:
[
"
77
"
,
"
yellow
"
]
},
'
zh-cn
'
:
{
// encoding issues here, maybe we should consider load mappings remotely
// will display as "锟斤铐锟斤铐锟斤铐", lmao
// 200: "常驻",
// 301: "角色UP-1",
// 302: "武器UP"
200
:
"
Standard
"
,
301
:
"
Event Avatar
"
,
302
:
"
Event Weapon
"
,
}
};
</script>
<!-- This file could be generated automatically using `java -jar grasscutter.jar -gachamap` -->
<!-- This file could be generated automatically using `java -jar grasscutter.jar -gachamap` -->
<!-- You can also modify the file manually to customize it -->
<!-- You can also modify the file manually to customize it -->
<!-- Otherwise you may onle see number IDs in the gacha record -->
<!-- Otherwise you may onle see number IDs in the gacha record -->
<script
type=
"text/javascript"
src=
"/gacha/mappings"
></script>
<script
type=
"text/javascript"
src=
"/gacha/mappings"
></script>
<script>
<script>
record
=
{{
REPLACE_RECORD
}};
maxPage
=
{{
REPLACE_MAXPAGE
}};
mappings
[
'
default
'
]
=
mappings
[
'
en-us
'
];
// make en-us as default/fallback option
mappings
[
'
default
'
]
=
mappings
[
'
en-us
'
];
// make en-us as default/fallback option
</script>
</script>
</head>
</head>
...
@@ -161,32 +128,12 @@
...
@@ -161,32 +128,12 @@
}
}
return
"
<span class='blue'>
"
+
itemID
+
"
</span>
"
;
return
"
<span class='blue'>
"
+
itemID
+
"
</span>
"
;
}
}
function
dateFormatter
(
timeStamp
)
{
var
date
=
new
Date
(
timeStamp
);
if
(
lang
==
"
en-us
"
||
lang
==
null
)
{
// MM/DD/YYYY hh:mm:ss.SSS
return
String
(
date
.
getMonth
()
+
1
).
padStart
(
2
,
"
0
"
)
+
"
/
"
+
String
(
date
.
getDate
()).
padStart
(
2
,
"
0
"
)
+
"
/
"
+
date
.
getFullYear
()
+
"
"
+
String
(
date
.
getHours
()).
padStart
(
2
,
"
0
"
)
+
"
:
"
+
String
(
date
.
getMinutes
()).
padStart
(
2
,
"
0
"
)
+
"
:
"
+
String
(
date
.
getSeconds
()).
padStart
(
2
,
"
0
"
)
+
"
.
"
+
String
(
date
.
getMilliseconds
()).
padStart
(
3
,
"
0
"
);
}
else
if
(
lang
==
"
zh-cn
"
)
{
// YYYY/MM/DD hh:mm:ss.SSS
return
date
.
getFullYear
()
+
"
/
"
+
String
(
date
.
getMonth
()
+
1
).
padStart
(
2
,
"
0
"
)
+
"
/
"
+
String
(
date
.
getDate
()).
padStart
(
2
,
"
0
"
)
+
"
"
+
String
(
date
.
getHours
()).
padStart
(
2
,
"
0
"
)
+
"
:
"
+
String
(
date
.
getMinutes
()).
padStart
(
2
,
"
0
"
)
+
"
:
"
+
String
(
date
.
getSeconds
()).
padStart
(
2
,
"
0
"
)
+
"
.
"
+
String
(
date
.
getMilliseconds
()).
padStart
(
3
,
"
0
"
);
}
}
(
function
(){
(
function
(){
var
container
=
document
.
getElementById
(
"
container
"
);
var
container
=
document
.
getElementById
(
"
container
"
);
record
.
forEach
(
element
=>
{
record
.
forEach
(
element
=>
{
var
e
=
document
.
createElement
(
"
tr
"
);
var
e
=
document
.
createElement
(
"
tr
"
);
e
.
innerHTML
=
"
<td>
"
+
dateFormat
te
r
(
element
.
time
)
+
"
</td><td>
"
+
itemMapper
(
element
.
item
)
+
"
</td>
"
;
e
.
innerHTML
=
"
<td>
"
+
(
new
Da
te
(
element
.
time
)
.
toLocaleString
(
lang
))
+
"
</td><td>
"
+
itemMapper
(
element
.
item
)
+
"
</td>
"
;
container
.
appendChild
(
e
);
container
.
appendChild
(
e
);
});
});
// setup pagenation buttons
// setup pagenation buttons
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment