Skip to content

Commit

Permalink
Fixed time presenter
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Brechka <[email protected]>
  • Loading branch information
Anton Brechka committed Jan 27, 2023
1 parent 40c367a commit 86b81a7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/ui/src/components/calendar/DateRangePopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
const dispatch = createEventDispatcher()
const today: Date = new Date(Date.now())
$: currentDate = $dpstore.currentDate ?? today
const defaultDate = mode === DateRangeMode.TIME ? new Date(0) : new Date(Date.now())
$: currentDate = $dpstore.currentDate ?? defaultDate
const mondayStart: boolean = true
$: base = direction === 'before' ? -1 : 1
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/components/calendar/DateRangePresenter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@
if ((edit.value < 1 || i > 2) && full) result = true
if (mode === DateRangeMode.TIME) {
if (i > 2 && edit.value < 1) result = true
} else if (i < 3 && !full && edit.value < 1) {
if (i > 2 && edit.value < 0) result = true
} else if (i < 3 && !full && edit.value < 0) {
result = true
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
import { DateRangePresenter } from '@hcengineering/ui'
import tracker from '../../plugin'
export let value: Scrum
const client = getClient()
export let value: WithLookup<Scrum>
$: beginTime = value.beginTime
$: endTime = value.endTime
Expand All @@ -37,13 +38,19 @@
mode={DateRangeMode.TIME}
labelNull={tracker.string.ScrumBeginTime}
on:change={(res) => updateObject({ beginTime: res.detail })}
noShift
editable
/>
-
<DateRangePresenter
value={endTime}
mode={DateRangeMode.TIME}
labelNull={tracker.string.ScrumEndTime}
on:change={(res) => updateObject({ endTime: res.detail })}
on:change={(res) => {
if (!beginTime || res.detail > beginTime) {
updateObject({ endTime: res.detail})
}
}}
noShift
editable
/>

0 comments on commit 86b81a7

Please sign in to comment.