mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
grafana/ui: Add Time of day picker (#18894)
* Adding DashboardPicker component * fix prop names * fix prop names pt2 * add component and modify utils * add showHour prop * add minuteStep to TimeOfDayPicker, add value to DashboardPicker * fix for dashboard picker, missed adding file * Adding story * add another story for hiding hour and style fixes * fix these generated files * fixes after review * rename current value * fix type issue on onChange * fix story
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { TimeZone } from '../types/time';
|
||||
/* tslint:disable:import-blacklist ban ban-types */
|
||||
import moment, { MomentInput, DurationInputArg1 } from 'moment';
|
||||
|
||||
import moment, { Moment, MomentInput, DurationInputArg1 } from 'moment';
|
||||
export interface DateTimeBuiltinFormat {
|
||||
__momentBuiltinFormatBrand: any;
|
||||
}
|
||||
@@ -72,6 +71,7 @@ export interface DateTime extends Object {
|
||||
utc: () => DateTime;
|
||||
utcOffset: () => number;
|
||||
hour?: () => number;
|
||||
minute?: () => number;
|
||||
}
|
||||
|
||||
export const setLocale = (language: string) => {
|
||||
@@ -98,6 +98,10 @@ export const dateTime = (input?: DateTimeInput, formatInput?: FormatInput): Date
|
||||
return moment(input as MomentInput, formatInput) as DateTime;
|
||||
};
|
||||
|
||||
export const dateTimeAsMoment = (input?: DateTimeInput) => {
|
||||
return dateTime(input) as Moment;
|
||||
};
|
||||
|
||||
export const dateTimeForTimeZone = (
|
||||
timezone?: TimeZone,
|
||||
input?: DateTimeInput,
|
||||
|
Reference in New Issue
Block a user