2022-05-12 07:05:26 +00:00
|
|
|
<script lang="ts">
|
2023-02-03 05:47:25 +00:00
|
|
|
import { DateRangeMode, Timestamp, TypeDate } from '@hcengineering/core'
|
2022-09-21 08:08:25 +00:00
|
|
|
import { ticker, tooltip } from '@hcengineering/ui'
|
|
|
|
import { DateEditor } from '@hcengineering/view-resources'
|
2022-05-12 07:05:26 +00:00
|
|
|
import EmployeeStatusDueDatePopup from './EmployeeStatusDueDatePopup.svelte'
|
|
|
|
import { formatDate } from '../utils'
|
|
|
|
import { createEventDispatcher } from 'svelte'
|
|
|
|
|
|
|
|
export let statusDueDate: Timestamp | undefined
|
|
|
|
|
|
|
|
$: isOverdue = statusDueDate && statusDueDate < $ticker
|
|
|
|
$: formattedDate = statusDueDate && formatDate(statusDueDate)
|
|
|
|
|
|
|
|
const dispatch = createEventDispatcher()
|
2023-02-03 05:47:25 +00:00
|
|
|
const type = { mode: DateRangeMode.DATETIME, withShift: true } as TypeDate
|
2022-05-12 07:05:26 +00:00
|
|
|
</script>
|
|
|
|
|
2022-06-30 03:41:46 +00:00
|
|
|
<div
|
|
|
|
class="clear-mins"
|
|
|
|
use:tooltip={{ direction: 'top', component: EmployeeStatusDueDatePopup, props: { formattedDate, isOverdue } }}
|
2022-05-12 07:05:26 +00:00
|
|
|
>
|
|
|
|
<DateEditor
|
|
|
|
value={statusDueDate}
|
|
|
|
{type}
|
|
|
|
onChange={(v) => {
|
|
|
|
statusDueDate = v
|
|
|
|
dispatch('change', v)
|
|
|
|
}}
|
|
|
|
/>
|
2022-06-30 03:41:46 +00:00
|
|
|
</div>
|