5 changed files with 67 additions and 50 deletions
@ -1,24 +0,0 @@ |
|||||||
<script> |
|
||||||
|
|
||||||
let { onSet = (dateTime) => {}, value = ' ' } = $props(); |
|
||||||
|
|
||||||
let date = $state(value.split(' ')[0]); |
|
||||||
let time = $state(value.split(' ')[1]); |
|
||||||
|
|
||||||
console.log({date:date,time:time,value:value}); |
|
||||||
|
|
||||||
function handleSubmit(e){ |
|
||||||
e.preventDefault(); |
|
||||||
onSet(`${date} ${time}`); |
|
||||||
} |
|
||||||
</script> |
|
||||||
|
|
||||||
<style> |
|
||||||
button{ display: none } |
|
||||||
</style> |
|
||||||
|
|
||||||
<form onsubmit={handleSubmit} > |
|
||||||
<input type="date" bind:value={date} /> |
|
||||||
<input type="time" bind:value={time} /> |
|
||||||
<button type="submit">ok</button> |
|
||||||
</form> |
|
||||||
@ -0,0 +1,37 @@ |
|||||||
|
<script> |
||||||
|
import { t } from '../translations.svelte.js'; |
||||||
|
import MarkdownEditor from './MarkdownEditor.svelte'; |
||||||
|
|
||||||
|
let { record = null, onSet = time => {} } = $props(); |
||||||
|
|
||||||
|
function onsubmit(e){ |
||||||
|
e.preventDefault(); |
||||||
|
onSet(record); |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
{#if record} |
||||||
|
<form {onsubmit}> |
||||||
|
<fieldset> |
||||||
|
<legend>{t('edit_object',{object:t('record')})}</legend> |
||||||
|
<label> |
||||||
|
{t('start')} |
||||||
|
<input type="datetime-local" bind:value={record.start_time} /> |
||||||
|
</label> |
||||||
|
<label> |
||||||
|
{t('end')} |
||||||
|
<input type="datetime-local" bind:value={record.end_time} /> |
||||||
|
</label> |
||||||
|
<label> |
||||||
|
{t('subject')} |
||||||
|
<input type="text" bind:value={record.subject} /> |
||||||
|
</label> |
||||||
|
<label> |
||||||
|
{t('description')} |
||||||
|
<MarkdownEditor simple={true} bind:value={record.description} /> |
||||||
|
</label> |
||||||
|
<button type="submit">{t('save')}</button> |
||||||
|
</fieldset> |
||||||
|
</form> |
||||||
|
{record.description.source} |
||||||
|
{/if} |
||||||
Loading…
Reference in new issue