feat: return action rejections from arrs (#103)

* refactor: push status

* feat: return push status for arr actions
This commit is contained in:
Ludvig Lundgren 2022-01-29 17:53:44 +01:00 committed by GitHub
parent 20138030e1
commit 373c85f060
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 294 additions and 255 deletions

View file

@ -1,3 +1,5 @@
import { formatDistanceToNowStrict, formatISO9075 } from "date-fns";
// sleep for x ms
export function sleep(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
@ -56,4 +58,23 @@ export function classNames(...classes: string[]) {
}
// column widths for inputs etc
export type COL_WIDTHS = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
export type COL_WIDTHS = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
// simplify date
export function simplifyDate(date: string) {
if (date !== "0001-01-01T00:00:00Z") {
return formatISO9075(new Date(date))
}
return "n/a"
}
// if empty date show as n/a
export function IsEmptyDate(date: string) {
if (date !== "0001-01-01T00:00:00Z") {
return formatDistanceToNowStrict(
new Date(date),
{ addSuffix: true }
)
}
return "n/a"
}