Skip to content

Commit

Permalink
bad fix on phone for david’s time formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
t5r7 committed Jun 6, 2023
1 parent 1891060 commit 06e512d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/addedit.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ function setActual(which) {
}

function setNow(which) {
const now = new Intl.DateTimeFormat('da-DK', { dateStyle: 'short', timeStyle: 'short', timeZone: 'Europe/Copenhagen' }).format(new Date())

let now = new Intl.DateTimeFormat('da-DK', { dateStyle: 'short', timeStyle: 'short', timeZone: 'Europe/Copenhagen' }).format(new Date())
now = now.split("").reverse().join("").replace(".",":").split("").reverse().join("");

if(which === "dep") {
journey.departureTimeActual = now;
} else {
Expand Down Expand Up @@ -382,4 +383,4 @@ function deleteExisting() {
function done() {
alert("Saved, hopefully! Taking you to the list of journeys...");
location.href = "localstorage.html";
}
}

0 comments on commit 06e512d

Please sign in to comment.