Skip to content

Commit

Permalink
UBER-641: fixed DatePopup. (#3535)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Platov <sas_lord@mail.ru>
  • Loading branch information
SasLord authored Jul 31, 2023
1 parent f7d68ee commit 2781082
Showing 1 changed file with 36 additions and 33 deletions.
69 changes: 36 additions & 33 deletions packages/ui/src/components/calendar/DatePopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import DateInputBox from './DateInputBox.svelte'
import MonthSquare from './MonthSquare.svelte'
import Shifts from './Shifts.svelte'
import { Scroller, deviceOptionsStore as deviceInfo } from '../..'
export let currentDate: Date | null
export let withTime: boolean = false
Expand All @@ -35,6 +36,7 @@
const dispatch = createEventDispatcher()
const today: Date = new Date(Date.now())
$: docHeight = $deviceInfo.docHeight
let viewDate: Date = currentDate ?? today
let viewDateSec: Date
Expand Down Expand Up @@ -91,40 +93,42 @@
/>
</div>
<div class="content">
<div class="label">
<span class="bold"><Label {label} /></span>
{#if detail}
<span class="divider">-</span>
<Label label={detail} />
{/if}
</div>

<DateInputBox
bind:this={dateInput}
bind:currentDate
{withTime}
on:close={() => closeDP(withTime)}
on:save={() => saveDate(withTime)}
/>

<div class="month-group">
<MonthSquare
<Scroller padding={'1.5rem 2rem'} thinScrollBars>
<div class="label">
<span class="bold"><Label {label} /></span>
{#if detail}
<span class="divider">-</span>
<Label label={detail} />
{/if}
</div>

<DateInputBox
bind:this={dateInput}
bind:currentDate
{viewDate}
{mondayStart}
viewUpdate={false}
hideNavigator="all"
on:update={(result) => updateDate(result.detail)}
{withTime}
on:close={() => closeDP(withTime)}
on:save={() => saveDate(withTime)}
/>
<MonthSquare
bind:currentDate
viewDate={viewDateSec}
{mondayStart}
viewUpdate={false}
on:update={(result) => updateDate(result.detail)}
on:navigation={(result) => navigateMonth(result.detail)}
/>
</div>

<div class="month-group">
<MonthSquare
bind:currentDate
{viewDate}
{mondayStart}
viewUpdate={false}
hideNavigator="all"
on:update={(result) => updateDate(result.detail)}
/>
<MonthSquare
bind:currentDate
viewDate={viewDateSec}
{mondayStart}
viewUpdate={false}
on:update={(result) => updateDate(result.detail)}
on:navigation={(result) => navigateMonth(result.detail)}
/>
</div>
</Scroller>
</div>
<div class="footer">
<Button
Expand Down Expand Up @@ -172,7 +176,6 @@
overflow: hidden;
display: flex;
flex-direction: column;
padding: 1.5rem 2rem;
min-height: 0;
.label {
Expand Down

0 comments on commit 2781082

Please sign in to comment.