mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Use dateTime vs new Date() (#37210)
This commit is contained in:
parent
b5f464412d
commit
8c8d2fe08b
@ -1,6 +1,6 @@
|
||||
import React, { ChangeEvent } from 'react';
|
||||
import { css } from '@emotion/css';
|
||||
import { dateTimeFormat } from '@grafana/data';
|
||||
import { dateTime, dateTimeFormat } from '@grafana/data';
|
||||
import { DatePicker } from '../DatePicker/DatePicker';
|
||||
import { Props as InputProps, Input } from '../../Input/Input';
|
||||
import { useStyles } from '../../../themes';
|
||||
@ -46,7 +46,7 @@ export const DatePickerWithInput = ({
|
||||
/>
|
||||
<DatePicker
|
||||
isOpen={open}
|
||||
value={value && typeof value !== 'string' ? value : new Date()}
|
||||
value={value && typeof value !== 'string' ? value : dateTime().toDate()}
|
||||
onChange={(ev) => {
|
||||
onChange(ev);
|
||||
if (closeOnSelect) {
|
||||
|
Loading…
Reference in New Issue
Block a user