fix types
This commit is contained in:
+1
-3
@@ -118,9 +118,7 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Do not use any type assertions.", "5"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "6"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "7"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "8"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "9"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "10"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "8"]
|
||||
],
|
||||
"packages/grafana-data/src/datetime/parser.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
|
||||
@@ -131,9 +131,17 @@ export const dateTimeForTimeZone = (
|
||||
}
|
||||
|
||||
if (timezone && timezone !== 'browser') {
|
||||
// TODO fix types here
|
||||
//@ts-ignore
|
||||
return moment.tz(input as MomentInput, formatInput, timezone) as DateTime;
|
||||
let result: moment.Moment;
|
||||
|
||||
if (typeof input === 'string' && formatInput) {
|
||||
result = moment.tz(input, formatInput, timezone);
|
||||
} else {
|
||||
result = moment.tz(input, timezone);
|
||||
}
|
||||
|
||||
if (isDateTime(result)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return dateTime(input, formatInput);
|
||||
|
||||
Reference in New Issue
Block a user