Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- adds tooltip and coloration to dates - updates size and color of status icons
- Loading branch information
Showing
5 changed files
with
114 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { fromNow } from '../../../../../system/date'; | ||
|
||
export function fromDateRange(date: Date, startDate = new Date()) { | ||
const seconds = Math.floor((startDate.getTime() - date.getTime()) / 1000); | ||
let status = 'ok'; | ||
if (Math.floor(seconds / 31536000) >= 1) { | ||
status = 'danger'; | ||
} else if (Math.floor(seconds / 2592000) >= 1) { | ||
status = 'danger'; | ||
} else if (Math.floor(seconds / 604800) >= 1) { | ||
status = 'danger'; | ||
} else if (Math.floor(seconds / 86400) >= 1) { | ||
status = 'warning'; | ||
} | ||
|
||
return { | ||
label: fromNow(date, true), | ||
tooltip: fromNow(date), | ||
status: status, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters