implemented editor for times
This commit is contained in:
37
frontend/src/Components/TimeRecordEditor.svelte
Normal file
37
frontend/src/Components/TimeRecordEditor.svelte
Normal file
@@ -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}
|
||||
Reference in New Issue
Block a user