【发布时间】:2021-03-04 22:09:33
【问题描述】:
更新我的整个 Angular 项目后我遇到了一个问题,突然我得到“没有重载与此调用匹配。”并且读取错误“Type 'DateTimeTimeZone' is not assignable to type '日期'。"
这似乎发生在我的日期格式化函数上:
formattingDate(dateTime: DateTimeTimeZone): String {
try {
return (this.datepipe.transform(dateTime, 'dd MMMM yyyy'));
}
catch (error) {
this.alertsService.add('DateTimeTimeZone conversion error', JSON.stringify(error));
}
}
虽然 DateTimeTimeZone 包含以下内容:
// https://docs.microsoft.com/graph/api/resources/datetimetimezone?view=graph-rest-1.0
export class DateTimeTimeZone {
dateTime: string;
timeZone: string;
}
有没有快速简便的解决方案? 我不知道从哪里开始。
【问题讨论】:
-
您要使用哪个 API?
-
@ShivaKeshavVarma [docs.microsoft.com/en-gb/graph/api/resources/… 在 cmets...)
标签: angular typescript datetime microsoft-graph-api overloading