parent
2f357bccfb
commit
470586b5f5
@ -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))); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue