]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/duration.pipe.ts
import quincy beta 17.1.0
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / pipes / duration.pipe.ts
index 4675fc0f6c6d6fbe5c85af7b513c160d8353139f..687153b21b6e7e24d9398eee2a6d820564a23d97 100644 (file)
@@ -13,6 +13,9 @@ export class DurationPipe implements PipeTransform {
    * @return {string}         The phrase describing the the amount of time
    */
   transform(seconds: number): string {
+    if (seconds === null || seconds <= 0) {
+      return '';
+    }
     const levels = [
       [`${Math.floor(seconds / 31536000)}`, 'years'],
       [`${Math.floor((seconds % 31536000) / 86400)}`, 'days'],