mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
improve action on mobile
This commit is contained in:
@@ -6,11 +6,28 @@ import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { HttpErrorHandle} from 'src/app/services/http-error-handle.service';
|
||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
dateInput: "YYYY-MMMM-DD HH:mm"
|
||||
},
|
||||
display: {
|
||||
dateInput: "DD MMM YYYY H:mm",
|
||||
monthYearLabel: "MMM YYYY",
|
||||
dateA11yLabel: "LL",
|
||||
monthYearA11yLabel: "MMMM YYYY"
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit-action',
|
||||
templateUrl: './edit-action.page.html',
|
||||
styleUrls: ['./edit-action.page.scss'],
|
||||
providers: [
|
||||
{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },
|
||||
]
|
||||
})
|
||||
export class EditActionPage implements OnInit {
|
||||
|
||||
@@ -28,8 +45,6 @@ export class EditActionPage implements OnInit {
|
||||
public stepHour = 1;
|
||||
public stepMinute = 15;
|
||||
public stepSecond = 5;
|
||||
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
|
||||
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
|
||||
currentDate = new Date();
|
||||
|
||||
folder: PublicationFolder;
|
||||
@@ -71,26 +86,12 @@ export class EditActionPage implements OnInit {
|
||||
getPublicationDetail() {
|
||||
this.publicationsService.GetPresidentialAction(this.folderId).subscribe( res => {
|
||||
this.folder = res;
|
||||
|
||||
this.dateControlStart = new FormControl(moment(new Date(this.folder.DateBegin)));
|
||||
this.dateControlEnd = new FormControl(moment(new Date(this.folder.DateEnd)));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
get dateValid() {
|
||||
var validado: boolean;
|
||||
|
||||
if (window.innerWidth <= 800) {
|
||||
if ((this.folder.DateBegin < this.folder.DateEnd) && (new Date(this.folder.DateBegin).getTime() > this.currentDate.getTime())) {
|
||||
validado = true;
|
||||
}else{
|
||||
validado = false;
|
||||
}
|
||||
return validado == true ? ['ok']: [];
|
||||
} else {
|
||||
return ['ok']
|
||||
}
|
||||
return new Date(this.folder.DateBegin).getTime() < new Date(this.folder.DateEnd).getTime()? 'ok': null
|
||||
}
|
||||
|
||||
runValidation() {
|
||||
|
||||
Reference in New Issue
Block a user