DateTimePicker: Alternate timezones now behave correctly (#86750)
* Add failing tests for timezone handling * Fix `DateTimePicker.tsx` timezone handling - Resolves `onBlur` issue - Resolve Calendar and TimeOfDay issues - Update test to cover different timezone * Handle `console.warn` in test * Handle `console.warn` in test #2 * Better handling of invalid date When parsing date string with `dateTime`, adding a second `formatInput` aids in both parsing the actual string and avoid `console.warn` when `moment` reverts to be using `Date`. * add more test cases * Ash/proposed changes (#86854) * simplify * only need this change * formatting * const > let * add test to ensure calendar is always showing the matching day * separate state * undo story changes * update util function comments * fix for selecting date in the calendar --------- Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
This commit is contained in:
co-authored by
Ashley Harrison
parent
ccd2bff8b0
commit
7fab894e9b
@@ -53,7 +53,7 @@ export interface DateTimeDuration {
|
||||
|
||||
export interface DateTime extends Object {
|
||||
add: (amount?: DateTimeInput, unit?: DurationUnit) => DateTime;
|
||||
set: (unit: DurationUnit, amount: DateTimeInput) => void;
|
||||
set: (unit: DurationUnit | 'date', amount: DateTimeInput) => void;
|
||||
diff: (amount: DateTimeInput, unit?: DurationUnit, truncate?: boolean) => number;
|
||||
endOf: (unitOfTime: DurationUnit) => DateTime;
|
||||
format: (formatInput?: FormatInput) => string;
|
||||
|
||||
Reference in New Issue
Block a user