mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Add validation for mobile
This commit is contained in:
+18
-3
@@ -55,6 +55,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
public touchUi = false;
|
||||
public enableMeridian = false;
|
||||
public minDate = new Date();
|
||||
public ionicMinDate = new Date().toISOString().slice(0,10)
|
||||
|
||||
// curent timestamp + 15 minutes
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
@@ -172,6 +173,14 @@ export class BookMeetingModalPage implements OnInit {
|
||||
this.validateFrom = true
|
||||
}
|
||||
|
||||
get dateValid() {
|
||||
if (window.innerWidth <= 800) {
|
||||
return this.postData.StartDate < this.postData.EndDate? ['ok']: []
|
||||
} else {
|
||||
return ['ok']
|
||||
}
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
|
||||
this.Form = new FormGroup({
|
||||
@@ -184,7 +193,10 @@ export class BookMeetingModalPage implements OnInit {
|
||||
]),
|
||||
CalendarName: new FormControl(this.postData.CalendarName, [
|
||||
Validators.required
|
||||
])
|
||||
]),
|
||||
Date: new FormControl(this.dateValid, [
|
||||
Validators.required
|
||||
]),
|
||||
// participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [
|
||||
// Validators.required
|
||||
// ]),
|
||||
@@ -195,8 +207,11 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
async saveTask(){
|
||||
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
}
|
||||
|
||||
|
||||
if(this.Form.invalid) return false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user