mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-24 16:01:42 +00:00
feat(frontend): add missing date in the previous run panel (#3693)
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
type Job
|
||||
} from '$lib/gen/index.js'
|
||||
import { userStore, workspaceStore } from '$lib/stores.js'
|
||||
import { classNames, displayDate, sendUserToast } from '$lib/utils.js'
|
||||
import { classNames, displayDate, displayDateOnly, sendUserToast } from '$lib/utils.js'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { Pane, Splitpanes } from 'svelte-splitpanes'
|
||||
import ObjectViewer from './propertyPicker/ObjectViewer.svelte'
|
||||
@@ -377,11 +377,16 @@
|
||||
{i.created_by}
|
||||
</div>
|
||||
<div
|
||||
class="whitespace-nowrap col-span-3 !text-tertiary !text-2xs overflow-hidden text-ellipsis flex-shrink text-center"
|
||||
class="whitespace-nowrap col-span-2 !text-tertiary !text-2xs overflow-hidden text-ellipsis flex-shrink text-center"
|
||||
>
|
||||
{displayDateOnly(new Date(i.created_at))}
|
||||
</div>
|
||||
<div
|
||||
class="whitespace-nowrap col-span-2 !text-tertiary !text-2xs overflow-hidden text-ellipsis flex-shrink text-center"
|
||||
>
|
||||
<TimeAgo date={i.created_at ?? ''} />
|
||||
</div>
|
||||
<div class="col-span-2">
|
||||
<div class="col-span-1">
|
||||
<a
|
||||
target="_blank"
|
||||
href="/run/{i.id}?workspace={$workspaceStore}"
|
||||
|
||||
@@ -36,6 +36,19 @@ export function parseQueryParams(url: string | undefined) {
|
||||
return params
|
||||
}
|
||||
|
||||
export function displayDateOnly(dateString: string | Date | undefined): string {
|
||||
const date = new Date(dateString ?? '')
|
||||
if (date.toString() === 'Invalid Date') {
|
||||
return ''
|
||||
} else {
|
||||
return date.toLocaleDateString([], {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export function displayDate(
|
||||
dateString: string | Date | undefined,
|
||||
displaySecond = false,
|
||||
|
||||
Reference in New Issue
Block a user