Skip to content

Commit

Permalink
to convert seconds to ms
Browse files Browse the repository at this point in the history
  • Loading branch information
abhisheksingla02 committed Jun 14, 2022
1 parent ebf6c51 commit ef5088a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
create: function(context, widget) {
var dashboardId = context.rootGetters["countlyDashboards/selected"].id;
var settings = widget.settings || {};
if (widget.settings.custom_period && typeof widget.settings.custom_period === "object") {
if (widget.settings && widget.settings.custom_period && typeof widget.settings.custom_period === "object") {
if (Array.isArray(widget.settings.custom_period)) {
if (widget.settings.custom_period[0] && widget.settings.custom_period[0].toString().length === 13) {
widget.settings.custom_period[0] = Math.floor(widget.settings.custom_period[0] / 1000);
Expand All @@ -343,7 +343,7 @@
var dashboardId = context.rootGetters["countlyDashboards/selected"].id;
var widgetId = widget.id;
var settings = widget.settings;
if (widget.settings.custom_period && typeof widget.settings.custom_period === "object") {
if (widget.settings && widget.settings.custom_period && typeof widget.settings.custom_period === "object") {
if (Array.isArray(widget.settings.custom_period)) {
if (widget.settings.custom_period[0] && widget.settings.custom_period[0].toString().length === 13) {
widget.settings.custom_period[0] = Math.floor(widget.settings.custom_period[0] / 1000);
Expand Down

0 comments on commit ef5088a

Please sign in to comment.