diff --git a/src/app/pages/trade/order-oil-list/order-oil-list.component.html b/src/app/pages/trade/order-oil-list/order-oil-list.component.html index 1a8f52c..b776ff3 100644 --- a/src/app/pages/trade/order-oil-list/order-oil-list.component.html +++ b/src/app/pages/trade/order-oil-list/order-oil-list.component.html @@ -228,7 +228,7 @@ diff --git a/src/app/pages/trade/order-oil-list/order-oil-list.component.ts b/src/app/pages/trade/order-oil-list/order-oil-list.component.ts index 895e84b..e4168fa 100644 --- a/src/app/pages/trade/order-oil-list/order-oil-list.component.ts +++ b/src/app/pages/trade/order-oil-list/order-oil-list.component.ts @@ -38,6 +38,7 @@ import {NzBadgeComponent} from "ng-zorro-antd/badge"; import {ButtonPipe} from "../../../pipes/common/button.pipe"; import {NzTooltipDirective} from "ng-zorro-antd/tooltip"; import {symlinkSync} from "fs"; +import {DateMinutesDiffPipe} from "../../../pipes/common/date-minutes-diff.pipe"; @Component({ selector: 'app-order-oil-list', @@ -86,6 +87,7 @@ import {symlinkSync} from "fs"; NzTimelineComponent, NzBadgeComponent, NzTooltipDirective, + DateMinutesDiffPipe ], templateUrl: './order-oil-list.component.html', styleUrl: './order-oil-list.component.less' @@ -397,5 +399,5 @@ export class OrderOilListComponent { }) } - + protected readonly Date = Date; } diff --git a/src/app/pipes/common/date-minutes-diff.pipe.ts b/src/app/pipes/common/date-minutes-diff.pipe.ts new file mode 100644 index 0000000..f3f4e84 --- /dev/null +++ b/src/app/pipes/common/date-minutes-diff.pipe.ts @@ -0,0 +1,18 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'dateMinutesDiff', + standalone: true +}) +/** + * 时间分钟差异 + */ +export class DateMinutesDiffPipe implements PipeTransform { + + + transform(newTime: number | Date, olbTime: number | Date): number { + var diffTimeStamp = new Date().getTime() - new Date(olbTime).getTime(); + return parseInt(String(diffTimeStamp / (1000 * 60))); + } + +}