Add: get reviews and fix bug

This commit is contained in:
2021-12-13 04:47:00 +08:00
parent 6b8bfedb9b
commit 12739be2f5
6 changed files with 151 additions and 10 deletions

View File

@@ -35,6 +35,30 @@ function numberWithCommas(x) {
return x;
}
// convert unix timestamp to %Y-%m-%d %H:%M:%S
export function convertIntToDateTime(timestamp) {
var date = new Date(timestamp * 1000);
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
var hour = date.getHours();
var minute = date.getMinutes();
var second = date.getSeconds();
var time =
year +
"-" +
(month < 10 ? "0" + month : month) +
"-" +
(day < 10 ? "0" + day : day) +
" " +
(hour < 10 ? "0" + hour : hour) +
":" +
(minute < 10 ? "0" + minute : minute) +
":" +
(second < 10 ? "0" + second : second);
return time;
}
export function SayHello() {
return "Hello";
}