Add fiscal years and search to time picker (#39073)

* Add search to time picker

* implement fiscal datemath

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
This commit is contained in:
Oscar Kilhed
2021-09-30 09:40:02 +02:00
committed by GitHub
co-authored by Dominik Prokop
parent 787e5e78dd
commit 738d5e499e
30 changed files with 457 additions and 164 deletions
+2 -1
View File
@@ -19,6 +19,7 @@ export interface DateTimeOptionsWhenParsing extends DateTimeOptions {
* the returned DateTime value will be 06:00:00.
*/
roundUp?: boolean;
fiscalYearStartMonth?: number;
}
type DateTimeParser<T extends DateTimeOptions = DateTimeOptions> = (value: DateTimeInput, options?: T) => DateTime;
@@ -56,7 +57,7 @@ const parseString = (value: string, options?: DateTimeOptionsWhenParsing): DateT
return moment() as DateTime;
}
const parsed = parse(value, options?.roundUp, options?.timeZone);
const parsed = parse(value, options?.roundUp, options?.timeZone, options?.fiscalYearStartMonth);
return parsed || (moment() as DateTime);
}