Skip to content

Commit

Permalink
ui: date range control style
Browse files Browse the repository at this point in the history
  • Loading branch information
nichenqin committed Nov 21, 2024
1 parent b733aa2 commit 8e7c41e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,24 @@
>
{#if internalValue && internalValue.start}
{#if internalValue.end}
{formatter(internalValue.start.toDate())} - {formatter(internalValue.end.toDate())}
<span class="flex items-center gap-1">
<span class="rounded-sm border bg-gray-50 px-1 py-0.5">
{formatter(internalValue.start.toDate())}
</span>
<span class="mx-1 text-xs text-gray-500"> - </span>
<span class="rounded-sm border bg-gray-50 px-1 py-0.5">
{formatter(internalValue.end.toDate())}
</span>
</span>
{:else}
{formatter(internalValue.start.toDate())}
<span class="rounded-sm border bg-gray-50 px-1 py-0.5">
{formatter(internalValue.start.toDate())}
</span>
{/if}
{:else if value?.[0]}
{formatter(new Date(value[0]))}
<span class="rounded-sm border bg-gray-50 px-1 py-0.5">
{formatter(new Date(value[0]))}
</span>
{/if}
</Button>
</Popover.Trigger>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,18 @@
{#if !value?.[0] && !value?.[1]}
{placeholder}
{:else if value?.[0] && value?.[1]}
{formatter(value[0])} - {formatter(value[1])}
<span class="flex items-center gap-1">
<span class="rounded-sm border bg-gray-50 px-1 py-0.5">
{formatter(value[0])}
</span>
<span class="mx-1 text-xs text-gray-500"> - </span>
<span class="rounded-sm border bg-gray-50 px-1 py-0.5">
{formatter(value[1])}
</span>
</span>
{:else if value?.[0]}
{formatter(value[0])}
<span class="rounded-sm border bg-gray-50 px-1 py-0.5">
{formatter(value[0])}
</span>
{/if}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,24 @@
<span class="flex w-full items-center truncate">
{#if internalValue && internalValue.start}
{#if internalValue.end}
{formatter(internalValue.start.toDate())} - {formatter(internalValue.end.toDate())}
<span class="flex items-center gap-1">
<span class="rounded-sm border bg-gray-50 px-1 py-0.5">
{formatter(internalValue.start.toDate())}
</span>
<span class="mx-1 text-xs text-gray-500"> - </span>
<span class="rounded-sm border bg-gray-50 px-1 py-0.5">
{formatter(internalValue.end.toDate())}
</span>
</span>
{:else}
{formatter(internalValue.start.toDate())}
<span class="rounded-sm border bg-gray-50 px-1 py-0.5">
{formatter(internalValue.start.toDate())}
</span>
{/if}
{:else if value?.[0]}
{formatter(new Date(value[0]))}
<span class="rounded-sm border bg-gray-50 px-1 py-0.5">
{formatter(new Date(value[0]))}
</span>
{/if}
</span>
{/if}
Expand Down

0 comments on commit 8e7c41e

Please sign in to comment.