From 5cf780326425469babd8b8a9c2753e8e459d179a Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Fri, 20 Mar 2020 10:34:35 +0100 Subject: [PATCH] Fix: failing tests when running on none english os. (#22913) --- public/app/core/utils/richHistory.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/public/app/core/utils/richHistory.ts b/public/app/core/utils/richHistory.ts index 168de580bc2..0249b9b8b40 100644 --- a/public/app/core/utils/richHistory.ts +++ b/public/app/core/utils/richHistory.ts @@ -2,7 +2,7 @@ import _ from 'lodash'; // Services & Utils -import { DataQuery, ExploreMode } from '@grafana/data'; +import { DataQuery, ExploreMode, dateTime } from '@grafana/data'; import { renderUrl } from 'app/core/utils/url'; import store from 'app/core/store'; import { serializeStateToUrlParam, SortOrder } from './explore'; @@ -212,10 +212,7 @@ export const createRetentionPeriodBoundary = (days: number, isLastTs: boolean) = }; export function createDateStringFromTs(ts: number) { - const date = new Date(ts); - const month = date.toLocaleString('default', { month: 'long' }); - const day = date.getDate(); - return `${month} ${day}`; + return dateTime(ts).format('MMMM D'); } export function getQueryDisplayText(query: DataQuery): string {