mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-17 19:05:13 +00:00
feat: Use V2 API's in Console (#9312)
# Which Problems Are Solved Solves #8976 # Additional Changes I have done some intensive refactorings and we are using the new @zitadel/client package for GRPC access. # Additional Context - Closes #8976 --------- Co-authored-by: Max Peintner <[email protected]>
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
|
||||
import { Timestamp as ConnectTimestamp } from '@bufbuild/protobuf/wkt';
|
||||
import { Timestamp } from 'src/app/proto/generated/google/protobuf/timestamp_pb';
|
||||
|
||||
@Pipe({
|
||||
name: 'timestampToDate',
|
||||
})
|
||||
export class TimestampToDatePipe implements PipeTransform {
|
||||
transform(value: Timestamp.AsObject, ...args: unknown[]): unknown {
|
||||
transform(value: ConnectTimestamp | Timestamp.AsObject, ...args: unknown[]): unknown {
|
||||
return this.dateFromTimestamp(value);
|
||||
}
|
||||
|
||||
private dateFromTimestamp(date: Timestamp.AsObject): any {
|
||||
private dateFromTimestamp(date: ConnectTimestamp | Timestamp.AsObject): any {
|
||||
if (date?.seconds !== undefined && date?.nanos !== undefined) {
|
||||
const ts: Date = new Date(date.seconds * 1000 + date.nanos / 1000 / 1000);
|
||||
return ts;
|
||||
return new Date(Number(date.seconds) * 1000 + date.nanos / 1000 / 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user