diff --git a/admin/src/app/features/calendar/components/calendar-view/calendar-view.html b/admin/src/app/features/calendar/components/calendar-view/calendar-view.html index e3cd40e..95c75a3 100644 --- a/admin/src/app/features/calendar/components/calendar-view/calendar-view.html +++ b/admin/src/app/features/calendar/components/calendar-view/calendar-view.html @@ -8,6 +8,9 @@ + @if (isOpen()){ + } + diff --git a/admin/src/app/features/calendar/components/calendar-view/calendar-view.ts b/admin/src/app/features/calendar/components/calendar-view/calendar-view.ts index e7e9ec9..8f5fc24 100644 --- a/admin/src/app/features/calendar/components/calendar-view/calendar-view.ts +++ b/admin/src/app/features/calendar/components/calendar-view/calendar-view.ts @@ -67,6 +67,7 @@ export class CalendarView implements OnInit, AfterViewInit { this.workflow.set('day'); this.selectedDate.set(info.date); this.selectedEventId.set(undefined); + console.info("date click with", this.selectedDate()) this.isOpen.set(true); // console.info('Date click on: ' , info); // const calendarApi = info.view.calendar; diff --git a/admin/src/app/features/calendar/components/create-event-form/create-event-form.html b/admin/src/app/features/calendar/components/create-event-form/create-event-form.html index 11e7a50..2ccfa10 100644 --- a/admin/src/app/features/calendar/components/create-event-form/create-event-form.html +++ b/admin/src/app/features/calendar/components/create-event-form/create-event-form.html @@ -10,7 +10,6 @@
-
@@ -39,8 +38,26 @@
+ @if (isRecurring?.value) { +

Ismétlődés

+ +
+ +
+ + } +
- Mégse + Mégse diff --git a/admin/src/app/features/calendar/components/create-event-form/create-event-form.ts b/admin/src/app/features/calendar/components/create-event-form/create-event-form.ts index 706c7bc..3930206 100644 --- a/admin/src/app/features/calendar/components/create-event-form/create-event-form.ts +++ b/admin/src/app/features/calendar/components/create-event-form/create-event-form.ts @@ -10,6 +10,12 @@ import { EventTypeService } from '../../../event-type/services/event-type.servic import { CalendarService } from '../../services/calendar.service'; import { EventFormDTO } from '../../models/event-form-dto.model'; +export type Frequency = 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY'; +export type FrequencyOption = { + frequency: Frequency, + label: string; +} + @Component({ selector: 'app-create-event-form', @@ -30,6 +36,23 @@ export class CreateEventForm implements OnInit { private numericFields = ["event_type_id"]; + frequencyOptions: FrequencyOption[] = [ + { + frequency: 'DAILY', + label: 'Napi' + }, + { + frequency: 'WEEKLY', + label: 'Heti' + }, { + frequency: 'MONTHLY', + label: 'Havi' + },{ + frequency: 'YEARLY', + label: 'Éves' + } + ] + constructor( private fb: FormBuilder, @@ -46,6 +69,16 @@ export class CreateEventForm implements OnInit { startTime: [null,Validators.required], endTime: [null,Validators.required], is_recurring: [null], + recurringRule: this.fb.group({ + frequency: [null] ,//'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY'; + interval: [null] ,//number + endDate: [null], // Date + count: [null], // number + byDay: [null], // string + byMonthDay: [null], // number + byMonth: [null], // number + + }) }); } @@ -53,11 +86,14 @@ export class CreateEventForm implements OnInit { of(this.id()).pipe( tap(id => { if (id) { + console.info("edit mode", 'edit') this.isEditMode = true; }else{ - const start = new Date(); - const end = new Date(); + const start = this.date() || new Date(); + const end = this.date() || new Date(); + + console.info("staring form with date", start,end); start.setMinutes(0,0); end.setHours(start.getHours()+1,0,0); start.setMinutes(start.getMinutes() - start.getTimezoneOffset()); @@ -88,6 +124,7 @@ export class CreateEventForm implements OnInit { return of(null); }), ).subscribe(event => { + console.info("subscribe form done") if (event) { this.form.patchValue(event); } @@ -141,6 +178,13 @@ export class CreateEventForm implements OnInit { return this.form.get('endTime'); } + get isRecurring(){ + return this.form.get('is_recurring'); + } + + get frequency(){ + return this.form.get('recurringRule')?.get('frequency'); + } doReady(){ this.ready.emit(); }