Skip to content

Commit

Permalink
Grumble: tz issues remain (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
signebedi committed Jun 25, 2024
1 parent 0c76a8d commit 71dd117
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libreforms_fastapi/app/static/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@ function renderUserRelationships(users) {



function prettifyTimeDiff(dateTimeStr, timeZone="America/New_York") {
function prettifyTimeDiff(dateTimeStr, tz="America/New_York") {
console.log(dateTimeStr);

// Parse the date string into a Date object
// const date = new Date(dateTimeStr);
const date = new Date(new Date(dateTimeStr).toLocaleString('en-US', { timeZone: timeZone }));
const date = new Date(new Date(dateTimeStr).toLocaleString('en-US', { timeZone: tz }));
// console.log(date);

// Get the current date and time
const now = new Date(new Date().toLocaleString('en-US', { timeZone: timeZone }));
const now = new Date(new Date().toLocaleString('en-US', { timeZone: tz }));
// const now = new Date();
// console.log(now);

Expand Down

0 comments on commit 71dd117

Please sign in to comment.