mirror of
https://github.com/BioArchLinux/bioarchlinux-packages.git
synced 2025-03-10 06:24:00 +00:00
format datetime in locale format
This commit is contained in:
parent
2d88988a50
commit
1c984070d5
1 changed files with 7 additions and 2 deletions
|
@ -21,6 +21,11 @@
|
||||||
<script src="https://cdn.jsdelivr.net/npm/datatables.net@1.10.20/js/jquery.dataTables.min.js"
|
<script src="https://cdn.jsdelivr.net/npm/datatables.net@1.10.20/js/jquery.dataTables.min.js"
|
||||||
integrity="sha256-LXQzPhL1IRyKkA7HpCOBi8I+OC8HqzHUYkjK8S+LKTs=" crossorigin="anonymous"></script>
|
integrity="sha256-LXQzPhL1IRyKkA7HpCOBi8I+OC8HqzHUYkjK8S+LKTs=" crossorigin="anonymous"></script>
|
||||||
<script>
|
<script>
|
||||||
|
const DATE_FORMATTER = new Intl.DateTimeFormat(undefined, {
|
||||||
|
timeStyle: "medium",
|
||||||
|
dateStyle: "medium",
|
||||||
|
hour12: false,
|
||||||
|
});
|
||||||
$(window).on('hashchange', function () {
|
$(window).on('hashchange', function () {
|
||||||
url = window.location.hash.includes("#") ? "/imlonghao-api/pkg/" + window.location.hash.slice(1) : "/imlonghao-api/logs"
|
url = window.location.hash.includes("#") ? "/imlonghao-api/pkg/" + window.location.hash.slice(1) : "/imlonghao-api/logs"
|
||||||
$.get(url, function (newDataArray) {
|
$.get(url, function (newDataArray) {
|
||||||
|
@ -93,7 +98,7 @@
|
||||||
title: "打包时间",
|
title: "打包时间",
|
||||||
data: "ts",
|
data: "ts",
|
||||||
render: function (data, type, row, meta) {
|
render: function (data, type, row, meta) {
|
||||||
return new Date(data * 1000).toISOString()
|
return DATE_FORMATTER.format(new Date(data * 1000))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -126,4 +131,4 @@
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Reference in a new issue