nicer dates
This commit is contained in:
parent
585b4e07ad
commit
70ac56522f
|
@ -157,6 +157,8 @@
|
||||||
|
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
opacity: 0;
|
||||||
|
overflow: hidden;
|
||||||
border: 1px solid var(--grey-4);
|
border: 1px solid var(--grey-4);
|
||||||
|
|
||||||
transition: width 300ms ease-in, height 300ms ease-in, top 300ms ease-in, left 300ms ease-in;
|
transition: width 300ms ease-in, height 300ms ease-in, top 300ms ease-in, left 300ms ease-in;
|
||||||
|
|
|
@ -7,6 +7,17 @@
|
||||||
}
|
}
|
||||||
export let schema
|
export let schema
|
||||||
export let columnName
|
export let columnName
|
||||||
|
|
||||||
|
const parseDate = (isoString) => {
|
||||||
|
if ([null, undefined, ""].includes(isoString)) {
|
||||||
|
return "None"
|
||||||
|
}
|
||||||
|
|
||||||
|
const epoch = Date.parse(isoString);
|
||||||
|
const date = new Date(epoch);
|
||||||
|
|
||||||
|
return date.toLocaleString();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,11 +34,11 @@
|
||||||
{:else if schema.type === "datetime"}
|
{:else if schema.type === "datetime"}
|
||||||
<Property
|
<Property
|
||||||
name="Earliest"
|
name="Earliest"
|
||||||
value={schema?.constraints?.datetime?.earliest === "" ? "None" : schema?.constraints?.datetime?.earliest}
|
value={parseDate(schema?.constraints?.datetime?.earliest)}
|
||||||
/>
|
/>
|
||||||
<Property
|
<Property
|
||||||
name="Latest"
|
name="Latest"
|
||||||
value={schema?.constraints?.datetime?.latest === "" ? "None" : schema?.constraints?.datetime?.latest}
|
value={parseDate(schema?.constraints?.datetime?.latest)}
|
||||||
/>
|
/>
|
||||||
<Property
|
<Property
|
||||||
name="Ignore time zones"
|
name="Ignore time zones"
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
|
|
||||||
.propertyDivider {
|
.propertyDivider {
|
||||||
padding: 0 2px;
|
padding: 0 4px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
<Line noWrap>
|
<Line noWrap>
|
||||||
<InfoWord
|
<InfoWord
|
||||||
on:mouseenter={() => setExplanationSubject(subjects.column)}
|
on:mouseenter={() => setExplanationSubject(subjects.column)}
|
||||||
|
on:mouseleave={() => setExplanationSubject(subjects.none)}
|
||||||
href={tableHref}
|
href={tableHref}
|
||||||
text={columnName}
|
text={columnName}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue