-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
17 additions
and
10 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 |
---|---|---|
@@ -1,12 +1,19 @@ | ||
<script> | ||
import { fieldData } from "../../lib/easydbHelpers"; | ||
import { P } from "flowbite-svelte"; | ||
export let data; | ||
export let field; | ||
export let table; | ||
import { fieldData } from "../../lib/easydbHelpers"; | ||
const fdata = fieldData(data, table, field); | ||
</script> | ||
|
||
<span class="easydb-daterange-field">{fdata["from"]} - {fdata["to"]}</span> | ||
export let data; | ||
export let field; | ||
export let table; | ||
const fdata = fieldData(data, table, field); | ||
const from = Number(fdata["from"]); | ||
const to = Number(fdata["to"]); | ||
</script> | ||
|
||
<!-- EasyDB seems to have a shortcut to collapse date ranges to actual dates if | ||
start and end that coincide. We do the same here. --> | ||
{#if from === to} | ||
<span class="easydb-daterange-field">{from}</span> | ||
{:else} | ||
<span class="easydb-daterange-field">{from} - {to}</span> | ||
{/if} |