mirror of
https://github.com/LinoSchmidt/StickExporterTX.git
synced 2026-03-21 01:51:15 +01:00
Added date format for other countrys
This commit is contained in:
8
src/components/dateFormat.ts
Normal file
8
src/components/dateFormat.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
function formatDate(year:number, month:number, day:number) {
|
||||
const date = new Date(year, month, day);
|
||||
return date.toLocaleDateString();
|
||||
}
|
||||
|
||||
export {
|
||||
formatDate
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import {blender, blenderCmd} from "../blenderController";
|
||||
import openFolder from "../openFolder";
|
||||
import {platformCharacter} from "../paths";
|
||||
import {getLogTime} from "../logReader";
|
||||
import {formatDate} from "../dateFormat";
|
||||
|
||||
function MainSide() {
|
||||
const [logs, setLogs] = useState(settingList.log);
|
||||
@@ -27,10 +28,10 @@ function MainSide() {
|
||||
for(const log of logList) {
|
||||
logListName.push(log.split(platformCharacter())[log.split(platformCharacter()).length - 1].replace(".csv", ""));
|
||||
const logTime = await getLogTime(log);
|
||||
const logTimeDisplay = logTime.start.day + "." + logTime.start.month + "." + logTime.start.year + " " + logTime.start.hour + ":" + logTime.start.minute + ":" + logTime.start.second;
|
||||
const logTimeDisplay = formatDate(logTime.start.year, logTime.start.month, logTime.start.day) + " " + logTime.start.hour + ":" + logTime.start.minute + ":" + logTime.start.second;
|
||||
logListTime.push(logTimeDisplay);
|
||||
|
||||
let logLengthDisplay = "0:00:00";
|
||||
let logLengthDisplay = "00:00:00";
|
||||
if(logTime.length.years > 0) {
|
||||
logLengthDisplay = logTime.length.years + "y " + logTime.length.months + "m " + logTime.length.days + "d " + logTime.length.hours + "h " + logTime.length.minutes + "m " + logTime.length.seconds + "s";
|
||||
} else if(logTime.length.months > 0) {
|
||||
|
||||
Reference in New Issue
Block a user