mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-16 13:21:57 +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">
|
||||
<Label label={board.string.Dates} />
|
||||
</div>
|
||||
<DatePresenter {value} on:click={dateHandler} />
|
||||
{#key value.date}
|
||||
<DatePresenter {value} on:click={dateHandler} />
|
||||
{/key}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
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 board from '../../plugin'
|
||||
import { getClient } from '@anticrm/presentation';
|
||||
@ -19,6 +19,13 @@
|
||||
let savedDueDate = object.date?.dueDate ?? Date.now()
|
||||
let dueDateEnabled = dueDate !== undefined
|
||||
$: 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>
|
||||
|
||||
<div class="antiPopup antiPopup-withHeader antiPopup-withTitle antiPopup-withCategory w-85">
|
||||
@ -70,7 +77,7 @@
|
||||
size={'small'}
|
||||
kind={'primary'}
|
||||
on:click={() => {
|
||||
client.update(object, {date: {startDate, dueDate}})
|
||||
update()
|
||||
dispatch('close')
|
||||
}}
|
||||
/>
|
||||
|
@ -8,11 +8,16 @@
|
||||
const client = getClient()
|
||||
const {date} = value
|
||||
let isChecked = date?.isChecked
|
||||
|
||||
function update(){
|
||||
if (isChecked === undefined) return
|
||||
client.update(value, {date: {...date, isChecked}})
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if date}
|
||||
<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-row-center background-button-bg-color border-radius-1 w-full">
|
||||
{#if date.startDate}
|
||||
|
Loading…
Reference in New Issue
Block a user