mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
change components in edit-event
This commit is contained in:
@@ -11,20 +11,33 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Event } from '../../../models/event.model';
|
||||
import { AttendeesPageModal } from '../../events/attendees/attendees.page';
|
||||
import { SearchPage } from '../../search/search.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||
import { NGX_MAT_DATE_FORMATS } 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-event',
|
||||
templateUrl: './edit-event.page.html',
|
||||
styleUrls: ['./edit-event.page.scss'],
|
||||
providers: [
|
||||
{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },
|
||||
]
|
||||
})
|
||||
export class EditEventPage implements OnInit {
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
public minDate = new Date().toISOString().slice(0,10)
|
||||
|
||||
postEvent: Event;
|
||||
isRecurring:string;
|
||||
@@ -41,6 +54,19 @@ export class EditEventPage implements OnInit {
|
||||
recurringTypes: any;
|
||||
selectedRecurringType: any;
|
||||
|
||||
public date: any;
|
||||
public disabled = false;
|
||||
public showSpinners = true;
|
||||
public showSeconds = false;
|
||||
public touchUi = false;
|
||||
public enableMeridian = false;
|
||||
public minDate = new Date().toISOString().slice(0,10)
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000).toISOString().slice(0,10)
|
||||
public maxDate: any;
|
||||
public stepHour = 1;
|
||||
public stepMinute = 5;
|
||||
public stepSecond = 5;
|
||||
|
||||
loadedEventAttachments: Attachment[] = [];
|
||||
taskParticipants: any = [];
|
||||
taskParticipantsCc: any = [];
|
||||
@@ -48,6 +74,11 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
showAttendees = false;
|
||||
|
||||
public listColors = ['primary', 'accent', 'warn'];
|
||||
public stepHours = [1, 2, 3, 4, 5];
|
||||
public stepMinutes = [1, 5, 10, 15, 20, 25];
|
||||
public stepSeconds = [1, 5, 10, 15, 20, 25];
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
@@ -59,10 +90,12 @@ export class EditEventPage implements OnInit {
|
||||
public ThemeService: ThemeService
|
||||
) {
|
||||
|
||||
this.postEvent = new Event();
|
||||
/* this.postEvent = new Event(); */
|
||||
this.isEventEdited = false;
|
||||
this.postEvent.EventRecurrence = { Type:'-1', LastOccurrence:''};
|
||||
/* this.postEvent.EventRecurrence = { Type:'-1', LastOccurrence:''}; */
|
||||
this.postEvent = this.navParams.get('event');
|
||||
console.log(this.postEvent);
|
||||
|
||||
this.caller = this.navParams.get('caller');
|
||||
this.initCalendarName = this.postEvent.CalendarName;
|
||||
|
||||
@@ -99,6 +132,7 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
window.onresize = (event) => {
|
||||
// if not mobile remove all component
|
||||
if( window.innerWidth >= 1024) {
|
||||
@@ -178,6 +212,28 @@ export class EditEventPage implements OnInit {
|
||||
})
|
||||
}
|
||||
|
||||
openInicio() {
|
||||
let input: any = document.querySelector('#new-inicio')
|
||||
if(input) {
|
||||
console.log(input)
|
||||
input.click()
|
||||
}
|
||||
}
|
||||
|
||||
openFim() {
|
||||
let input: any = document.querySelector('#new-fim')
|
||||
if(input) {
|
||||
input.click()
|
||||
}
|
||||
}
|
||||
|
||||
openLastOccurrence() {
|
||||
let input: any = document.querySelector('#last-occurrence')
|
||||
if(input) {
|
||||
input.click()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
save() {
|
||||
|
||||
@@ -207,7 +263,7 @@ export class EditEventPage implements OnInit {
|
||||
finally {
|
||||
this.goBack();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.toastService.successMessage();
|
||||
|
||||
Reference in New Issue
Block a user