funky-framadate-front/src/app/features/administration/form/steps/step-three/step-three.component.ts

53 lines
1.4 KiB
TypeScript
Raw Normal View History

2021-11-07 14:52:49 +01:00
import { Component, Input, OnInit } from '@angular/core';
import { PollService } from '../../../../../core/services/poll.service';
import { CdkDragDrop } from '@angular/cdk/drag-drop';
2021-12-17 12:19:32 +01:00
import { environment } from '../../../../../../environments/environment';
import { Title } from '@angular/platform-browser';
2021-11-07 14:52:49 +01:00
@Component({
selector: 'app-step-three',
templateUrl: './step-three.component.html',
styleUrls: ['./step-three.component.scss'],
})
export class StepThreeComponent implements OnInit {
@Input()
step_max: any;
@Input()
form: any;
2021-12-21 15:06:40 +01:00
public environment = environment;
minDate: any = new Date();
hideBackButton: boolean = true;
onMonthChangeCustom($event: any) {
// disable nav if new month is in past
console.log('$event', $event);
}
2021-11-07 14:52:49 +01:00
2021-12-17 12:19:32 +01:00
constructor(public pollService: PollService, private titleService: Title) {
this.hideBackButton = this.areWeOnCurrentMonth();
2021-11-16 16:16:30 +01:00
this.pollService.step_current = 3;
2021-12-17 12:19:32 +01:00
this.step_max = this.pollService.step_max;
2021-11-16 16:16:30 +01:00
}
2021-11-07 14:52:49 +01:00
ngOnInit(): void {}
drop(event: CdkDragDrop<string[]>) {
// moveItemInArray(this.pollService.choices, event.previousIndex, event.currentIndex);
}
2021-12-14 11:22:23 +01:00
convertDateInputs() {
this.pollService.mode_calendar
? this.pollService.convertCalendarToText()
: this.pollService.convertTextToCalendar();
2021-12-14 11:22:23 +01:00
}
2021-12-14 11:22:23 +01:00
changeDateInputMode() {
this.convertDateInputs();
this.pollService.mode_calendar = !this.pollService.mode_calendar;
}
private areWeOnCurrentMonth() {
return true;
}
2021-11-07 14:52:49 +01:00
}