mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Add validation for mobile
This commit is contained in:
@@ -14,7 +14,6 @@ import { AttendeesPageModal } from '../../events/attendees/attendees.page';
|
||||
import { SearchPage } from '../../search/search.page';
|
||||
import { ThemePalette } from '@angular/material/core';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import * as moment from 'moment';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -31,7 +30,7 @@ export class NewEventPage implements OnInit {
|
||||
public showSeconds = false;
|
||||
public touchUi = false;
|
||||
public enableMeridian = false;
|
||||
public minDate = new Date();
|
||||
public minDate = new Date().toISOString().slice(0,10)
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
public stepHour = 1;
|
||||
public stepMinute = 5;
|
||||
@@ -146,6 +145,15 @@ export class NewEventPage implements OnInit {
|
||||
this.validateFrom = true
|
||||
}
|
||||
|
||||
|
||||
get dateValid() {
|
||||
if (window.innerWidth <= 800) {
|
||||
return this.postEvent.StartDate < this.postEvent.EndDate? ['ok']: []
|
||||
} else {
|
||||
return ['ok']
|
||||
}
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
|
||||
this.Form = new FormGroup({
|
||||
@@ -159,6 +167,9 @@ export class NewEventPage implements OnInit {
|
||||
CalendarName: new FormControl(this.postEvent.CalendarName, [
|
||||
Validators.required
|
||||
]),
|
||||
Date: new FormControl(this.dateValid, [
|
||||
Validators.required
|
||||
]),
|
||||
Categories: new FormControl(this.postEvent.Categories[0], [
|
||||
Validators.required
|
||||
]),
|
||||
|
||||
Reference in New Issue
Block a user