mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-21 15:59:15 +00:00
Fix date (#1430)
Signed-off-by: Dvinyanin Alexandr <dvinyanin.alexandr@gmail.com>
This commit is contained in:
parent
2e5069f762
commit
ffa04233fe
@ -99,7 +99,9 @@
|
|||||||
<div class="text-md font-medium">
|
<div class="text-md font-medium">
|
||||||
<Label label={board.string.Dates} />
|
<Label label={board.string.Dates} />
|
||||||
</div>
|
</div>
|
||||||
<DatePresenter {value} on:click={dateHandler} />
|
{#key value.date}
|
||||||
|
<DatePresenter {value} on:click={dateHandler} />
|
||||||
|
{/key}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
import { Label, Button, DateRangePresenter, CheckBox, Component } from '@anticrm/ui'
|
import { Label, Button, DateRangePresenter, CheckBox, Component } from '@anticrm/ui'
|
||||||
import { Card } from '@anticrm/board'
|
import { Card, CardDate } from '@anticrm/board'
|
||||||
import calendar from '@anticrm/calendar'
|
import calendar from '@anticrm/calendar'
|
||||||
import board from '../../plugin'
|
import board from '../../plugin'
|
||||||
import { getClient } from '@anticrm/presentation';
|
import { getClient } from '@anticrm/presentation';
|
||||||
@ -19,6 +19,13 @@
|
|||||||
let savedDueDate = object.date?.dueDate ?? Date.now()
|
let savedDueDate = object.date?.dueDate ?? Date.now()
|
||||||
let dueDateEnabled = dueDate !== undefined
|
let dueDateEnabled = dueDate !== undefined
|
||||||
$: dueDate && (savedDueDate = dueDate)
|
$: dueDate && (savedDueDate = dueDate)
|
||||||
|
|
||||||
|
function update () {
|
||||||
|
const date: CardDate = {}
|
||||||
|
if (startDate !== undefined) date.startDate = startDate
|
||||||
|
if (dueDate !== undefined) date.dueDate = dueDate
|
||||||
|
client.update(object, {date})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="antiPopup antiPopup-withHeader antiPopup-withTitle antiPopup-withCategory w-85">
|
<div class="antiPopup antiPopup-withHeader antiPopup-withTitle antiPopup-withCategory w-85">
|
||||||
@ -70,7 +77,7 @@
|
|||||||
size={'small'}
|
size={'small'}
|
||||||
kind={'primary'}
|
kind={'primary'}
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
client.update(object, {date: {startDate, dueDate}})
|
update()
|
||||||
dispatch('close')
|
dispatch('close')
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -8,11 +8,16 @@
|
|||||||
const client = getClient()
|
const client = getClient()
|
||||||
const {date} = value
|
const {date} = value
|
||||||
let isChecked = date?.isChecked
|
let isChecked = date?.isChecked
|
||||||
|
|
||||||
|
function update(){
|
||||||
|
if (isChecked === undefined) return
|
||||||
|
client.update(value, {date: {...date, isChecked}})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if date}
|
{#if date}
|
||||||
<div class="flex-presenter flex-gap-1 h-full">
|
<div class="flex-presenter flex-gap-1 h-full">
|
||||||
<CheckBox bind:checked={isChecked} on:value={() => client.update(value, {date: {...date, isChecked}})}/>
|
<CheckBox bind:checked={isChecked} on:value={update}/>
|
||||||
<div class="flex-center h-full" on:click>
|
<div class="flex-center h-full" on:click>
|
||||||
<div class="flex-row-center background-button-bg-color border-radius-1 w-full">
|
<div class="flex-row-center background-button-bg-color border-radius-1 w-full">
|
||||||
{#if date.startDate}
|
{#if date.startDate}
|
||||||
|
Loading…
Reference in New Issue
Block a user