You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.6 KiB
57 lines
1.6 KiB
import { Component, OnInit } from '@angular/core';
|
|
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
import { Router } from '@angular/router';
|
|
import { TranslationContentService } from 'src/constants/language/TranslationContentService';
|
|
import { RouterService } from '../shared/services/routerService';
|
|
|
|
@Component({
|
|
selector: 'app-apply-leave',
|
|
templateUrl: './apply-leave.component.html',
|
|
styleUrls: ['./apply-leave.component.scss']
|
|
})
|
|
export class ApplyLeaveComponent implements OnInit {
|
|
public showAlertBox:boolean = false;
|
|
public languageConstants:any = '';
|
|
public leaveTypeList = ['Casual Leave', 'Sick Leave'];
|
|
public todayDate = new Date();
|
|
public exportTime = { hour: 7, minute: 15, meriden: 'PM', format: 24 };
|
|
|
|
constructor(private formBuilder: FormBuilder, private routerService: RouterService, private router: Router, private translationContentService:TranslationContentService) {
|
|
this.createNewForm();
|
|
}
|
|
|
|
applyLeaveForm!: FormGroup;
|
|
|
|
ngOnInit(): void {
|
|
this.translationContentService.getContent().subscribe((content: any) => {
|
|
this.languageConstants = Object.assign({}, content);
|
|
});
|
|
}
|
|
|
|
createNewForm(): void {
|
|
this.applyLeaveForm = this.formBuilder.group({
|
|
leaveType: [''],
|
|
from: [''],
|
|
to: [''],
|
|
startTime: [''],
|
|
endTime:[''],
|
|
reason:['']
|
|
});
|
|
}
|
|
|
|
onSubmitForm():void{
|
|
this.showAlertBox = true;
|
|
}
|
|
|
|
onReviewSubmit():void{
|
|
this.router.navigate(['flexiLeave']);
|
|
}
|
|
|
|
selectLeave(type:any):void{
|
|
console.log(type);
|
|
}
|
|
|
|
onChangeHour(event:any) {
|
|
console.log('event', event);
|
|
}
|
|
}
|