Skip to content

Commit

Permalink
fied dates to format DD.MM.YYY
Browse files Browse the repository at this point in the history
  • Loading branch information
sirjojo69 committed Jan 12, 2025
1 parent 265df41 commit 592cc03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,11 @@ async function main() {
const startTs = array[i].start_timestamp;
const start = new Date(startTs);
const startTime = start.toLocaleTimeString("de-DE");
const startDate = start.toLocaleDateString("de-DE");
const startDate = `${start.getDate().toString().padStart(2, "0")}.${(start.getMonth() + 1).toString().padStart(2, "0")}.${start.getFullYear()}`;
const endTs = array[i].end_timestamp;
const end = new Date(endTs);
const endTime = end.toLocaleTimeString("de-DE");
const endDate = end.toLocaleDateString("de-DE");
const endDate = `${end.getDate().toString().padStart(2, "0")}.${(end.getMonth() + 1).toString().padStart(2, "0")}.${end.getFullYear()}`;
const nettoPriceKwh = array[i].marketprice / 10; //price is in eur per MwH. Convert it in cent per KwH
const bruttoPriceKwh = nettoPriceKwh * mwstRate;
const totalPriceKwh = bruttoPriceKwh + workRate;
Expand Down

0 comments on commit 592cc03

Please sign in to comment.