Skip to content

Commit

Permalink
Add field type date
Browse files Browse the repository at this point in the history
  • Loading branch information
dokempf committed Jul 18, 2024
1 parent d2fffee commit 60776a2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/components/Date.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script>
import { fieldData } from "../lib/easydbHelpers";
export let data;
export let field;
export let table;
const fdata = fieldData(data, table, field);
</script>

<span class="easydb-date-field">{fdata["value"]}</span>
7 changes: 5 additions & 2 deletions src/components/FieldDispatch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import { P } from "flowbite-svelte";
// Import our field components
import Eas from "./Eas.svelte";
import FieldLabel from "./FieldLabel.svelte";
import CustomDataTypeUbhdgnd from "./CustomDataTypeUBHDGND.svelte";
import Date from "./Date.svelte";
import Daterange from "./Daterange.svelte";
import Eas from "./Eas.svelte";
import FieldLabel from "./FieldLabel.svelte";
import L10nTextField from "./L10nTextField.svelte";
import OnelineL10nTextField from "./OnelineL10nTextField.svelte";
import OnelineTextField from "./OnelineTextField.svelte";
Expand Down Expand Up @@ -35,6 +36,8 @@
<!-- Dispath based on the detected field type -->
{#if fieldtype === "custom:base.custom-data-type-ubhdgnd.ubhdgnd"}
<CustomDataTypeUbhdgnd data={data} field={field} table={table}/>
{:else if fieldtype === "date" }
<Date data={data} field={field} table={table}/>
{:else if fieldtype === "daterange" }
<Daterange data={data} field={field} table={table}/>
{:else if fieldtype === "eas" }
Expand Down

0 comments on commit 60776a2

Please sign in to comment.