From ea52d27d767646b3748740fc24e1c37f13fdd195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Guti=C3=A9rrez?= Date: Mon, 15 May 2023 12:07:26 -0600 Subject: [PATCH] MSPB-326: Use correct offset for call logs tz header (#497) --- submodules/callLogs/callLogs.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/submodules/callLogs/callLogs.js b/submodules/callLogs/callLogs.js index 2d3dadc0..16fe223f 100644 --- a/submodules/callLogs/callLogs.js +++ b/submodules/callLogs/callLogs.js @@ -1,8 +1,8 @@ define(function(require) { var $ = require('jquery'), _ = require('lodash'), - jstz = require('jstz'), - monster = require('monster'); + monster = require('monster'), + moment = require('moment'); var app = { requests: {}, @@ -53,14 +53,15 @@ define(function(require) { toDate = dates.to; } - var dataTemplate = { - timezone: 'GMT' + jstz.determine_timezone().offset(), - type: type || 'today', - fromDate: fromDate, - toDate: toDate, - showFilteredDates: ['thisMonth', 'thisWeek'].indexOf(type) >= 0, - showReport: monster.config.whitelabel.callReportEmail ? true : false - }; + var tz = monster.util.getCurrentTimeZone(), + dataTemplate = { + timezone: 'GMT' + moment().tz(tz).format('Z'), + type: type || 'today', + fromDate: fromDate, + toDate: toDate, + showFilteredDates: ['thisMonth', 'thisWeek'].indexOf(type) >= 0, + showReport: monster.config.whitelabel.callReportEmail ? true : false + }; self.callLogsGetCdrs(fromDate, toDate, function(cdrs, nextStartKey) { cdrs = self.callLogsFormatCdrs(cdrs);