fix(ui) - metrics x axis tick formating

This commit is contained in:
Shekar Siri 2022-11-18 12:11:42 +01:00
parent 986bfaa65e
commit 0d358b13d9
2 changed files with 2 additions and 2 deletions

View file

@ -6,7 +6,7 @@ import Session from "App/mstore/types/session";
import Funnelissue from 'App/mstore/types/funnelIssue';
import { issueOptions } from 'App/constants/filterOptions';
import { FilterKey } from 'Types/filter/filterType';
import Period, { LAST_24_HOURS, LAST_30_DAYS } from 'Types/app/period';
import Period, { LAST_24_HOURS } from 'Types/app/period';
export default class Widget {
public static get ID_KEY():string { return "metricId" }

View file

@ -27,7 +27,7 @@ const weekdays = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ];
// const months = [ "January", "February" ];
export const getTimeString = (ts, period) => {
const date = new Date(ts);
const diff = period.end - period.start;
const diff = period.endTimestamp - period.startTimestamp;
if (diff <= DAY) {
var isPM = date.getHours() >= 12;
return `${ isPM ? date.getHours() - 12 : date.getHours() }:${ startWithZero(date.getMinutes()) } ${isPM? 'pm' : 'am'}`;