From a6a09add7ab09bf444bc9f61b3b1829efbeea88a Mon Sep 17 00:00:00 2001 From: Alex Khomenko Date: Mon, 9 Aug 2021 12:37:53 +0300 Subject: [PATCH] DateTimePicker: Use TZ independent formatter (#37676) --- .../DatePickerWithInput/DatePickerWithInput.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/grafana-ui/src/components/DateTimePickers/DatePickerWithInput/DatePickerWithInput.tsx b/packages/grafana-ui/src/components/DateTimePickers/DatePickerWithInput/DatePickerWithInput.tsx index dc34ddc5a45..ea76baa8bab 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/DatePickerWithInput/DatePickerWithInput.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/DatePickerWithInput/DatePickerWithInput.tsx @@ -1,11 +1,11 @@ import React, { ChangeEvent } from 'react'; import { css } from '@emotion/css'; -import { dateTime, dateTimeFormat } from '@grafana/data'; +import { dateTime } from '@grafana/data'; import { DatePicker } from '../DatePicker/DatePicker'; import { Props as InputProps, Input } from '../../Input/Input'; import { useStyles } from '../../../themes'; -export const formatDate = (date: Date | string) => dateTimeFormat(date, { format: 'L' }); +export const formatDate = (date: Date | string) => dateTime(date).format('L'); /** @public */ export interface DatePickerWithInputProps extends Omit {