mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
change mobile components to display as desktop in new event
This commit is contained in:
@@ -7,6 +7,22 @@ import { IonicModule } from '@ionic/angular';
|
||||
import { NewEventPageRoutingModule } from './new-event-routing.module';
|
||||
|
||||
import { NewEventPage } from './new-event.page';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
|
||||
import { MatNativeDateModule } from '@angular/material/core';
|
||||
|
||||
import {
|
||||
NgxMatDatetimePickerModule,
|
||||
NgxMatNativeDateModule,
|
||||
NgxMatTimepickerModule
|
||||
} from '@angular-material-components/datetime-picker';
|
||||
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { NgxMatMomentModule } from '@angular-material-components/moment-adapter';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -14,6 +30,23 @@ import { NewEventPage } from './new-event.page';
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
NewEventPageRoutingModule,
|
||||
MatDatepickerModule,
|
||||
MatInputModule,
|
||||
MatNativeDateModule,
|
||||
//
|
||||
NgxMatDatetimePickerModule,
|
||||
NgxMatTimepickerModule,
|
||||
NgxMatNativeDateModule,
|
||||
//
|
||||
|
||||
NgxMatMomentModule,
|
||||
// BrowserAnimationsModule,
|
||||
// MatRadioModule,
|
||||
MatSelectModule,
|
||||
//MatRadioModule,
|
||||
//MatCheckboxModule,
|
||||
MatButtonModule,
|
||||
ReactiveFormsModule
|
||||
],
|
||||
declarations: [NewEventPage]
|
||||
})
|
||||
|
||||
@@ -18,39 +18,30 @@
|
||||
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="container-div" *ngIf="loggeduser.Profile == 'MDGPR'">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('CalendarName')?.invalid && validateFrom ">
|
||||
<ion-select placeholder="Selecione agenda*"
|
||||
selectedText="{{postEvent.CalendarName}}"
|
||||
[(ngModel)]="CalendarName"
|
||||
interface="action-sheet" Cancel-text="Cancelar"
|
||||
required>
|
||||
<ion-select-option value="PR"> Calendário do Presidente da República</ion-select-option>
|
||||
<ion-select-option value="MDGPR"> Meu calendário</ion-select-option>
|
||||
</ion-select>
|
||||
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs " [class.input-error]="Form?.get('CalendarName')?.invalid && validateFrom ">
|
||||
|
||||
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
|
||||
<mat-select [(value)]="CalendarName" >
|
||||
<!-- <mat-select [(value)]="postEvent.CalendarName" > -->
|
||||
<mat-option value="PR">
|
||||
Calendário do Presidente da República
|
||||
</mat-option>
|
||||
<mat-option value="MDGPR">
|
||||
Meu calendário
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- <div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('Subject').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('Subject').errors?.required">
|
||||
Campo obrigatório.
|
||||
</div>
|
||||
<div *ngIf="Form.get('Subject').errors?.minlength">
|
||||
O campo deve ter pelo menos 4 caracteres.
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
@@ -60,38 +51,26 @@
|
||||
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização*" [(ngModel)]="postEvent.Location"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Error messages -->
|
||||
<!-- <span class="error ion-padding" >
|
||||
Campo obrigatório
|
||||
</span> -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('Location').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('Location').errors?.required">
|
||||
Campo obrigatório.
|
||||
</div>
|
||||
<div *ngIf="Form.get('Location').errors?.minlength">
|
||||
O campo deve ter pelo menos 4 caracteres.
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('CalendarName')?.invalid && validateFrom ">
|
||||
<ion-select placeholder="Selecione agenda*"
|
||||
selectedText="{{postEvent.CalendarName}}"
|
||||
[(ngModel)]="postEvent.CalendarName"
|
||||
interface="action-sheet" Cancel-text="Cancelar"
|
||||
required>
|
||||
<ion-select-option value="Oficial">Oficial</ion-select-option>
|
||||
<ion-select-option value="Pessoal">Pessoal</ion-select-option>
|
||||
</ion-select>
|
||||
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs " [class.input-error]="Form?.get('CalendarName')?.invalid && validateFrom ">
|
||||
|
||||
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
|
||||
<mat-select [(value)]="postEvent.CalendarName" >
|
||||
<mat-option value="Oficial">
|
||||
Oficial
|
||||
</mat-option>
|
||||
<mat-option value="Pessoal">
|
||||
Pessoal
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -105,20 +84,30 @@
|
||||
</div> -->
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom ">
|
||||
<ion-select placeholder="Selecione tipo de evento*"
|
||||
[(ngModel)]="postEvent.Category"
|
||||
interface="action-sheet"
|
||||
Cancel-text="Cancelar" required>
|
||||
<ion-select-option value="Reunião">Reunião</ion-select-option>
|
||||
<ion-select-option value="Viagem">Viagem</ion-select-option>
|
||||
<ion-select-option value="Conferência">Conferência</ion-select-option>
|
||||
<ion-select-option value="Encontro">Encontro</ion-select-option>
|
||||
</ion-select>
|
||||
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs">
|
||||
|
||||
<mat-form-field appearance="none" class="width-100" placeholder="Sample Type" required>
|
||||
<!-- <input matInput type="text" > -->
|
||||
<mat-select [(value)]="postEvent.Category" >
|
||||
<mat-option value="Reunião">
|
||||
Reunião
|
||||
</mat-option>
|
||||
<mat-option value="Viagem">
|
||||
Viagem
|
||||
</mat-option>
|
||||
<mat-option value="Conferência">
|
||||
Conferência
|
||||
</mat-option>
|
||||
<mat-option value="Encontro">
|
||||
Encontro
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -133,78 +122,110 @@
|
||||
</div> -->
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-item-class-2 d-flex" >
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||
<ion-datetime
|
||||
placeholder="Início*"
|
||||
[(ngModel)]="postEvent.StartDate"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
max="2025"
|
||||
>
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data início" [(ngModel)]="postData.StartDate"></ion-input> -->
|
||||
|
||||
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs materia-top" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||
|
||||
<mat-form-field class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Choose a date"
|
||||
[(ngModel)]="postEvent.StartDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #picker1
|
||||
[showSpinners]="showSpinners"
|
||||
[showSeconds]="showSeconds"
|
||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||
[stepSecond]="stepSecond"
|
||||
[touchUi]="touchUi"
|
||||
>
|
||||
</ngx-mat-datetime-picker>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||
<ion-datetime
|
||||
placeholder="Fim*"
|
||||
[(ngModel)]="postEvent.EndDate"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
max="2025"
|
||||
<!--
|
||||
[className]="Form?.get('Subject')?.invalid ? 'input-error ion-input-class flex-grow-1' : 'ion-input-class ion-input-class flex-grow-1' "
|
||||
-->
|
||||
<div (click)="openFim()" class="ion-input-class flex-grow-1 justify-center align-center materia-top" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||
|
||||
<mat-form-field class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="fim"
|
||||
placeholder="Choose a date"
|
||||
[(ngModel)]="postEvent.EndDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #fim
|
||||
[showSpinners]="showSpinners"
|
||||
[showSeconds]="showSeconds"
|
||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||
[stepSecond]="stepSecond"
|
||||
>
|
||||
</ngx-mat-datetime-picker>
|
||||
</mat-form-field>
|
||||
|
||||
>
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div width-100">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-refresh.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom ">
|
||||
<ion-select placeholder="Selecione a repetição*"
|
||||
[(ngModel)]="selectedRecurringType"
|
||||
(ngModelChange)="onSelectedRecurringChanged($event)"
|
||||
interface="action-sheet"
|
||||
Cancel-text="Cancelar" required>
|
||||
<ion-select-option *ngFor="let recurring of recurringTypes" value="{{recurring.Code}}">{{recurring.Description}}</ion-select-option>
|
||||
</ion-select>
|
||||
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('dateOccurrence')?.invalid && validateFrom ">
|
||||
|
||||
<mat-form-field appearance="none" floatLabel="never" class="width-100" value="false" interface="action-sheet" required>
|
||||
<mat-select placeholder="Selecione repetição*"
|
||||
[(ngModel)]="postEvent.EventRecurrence.Type"
|
||||
(ngModelChange)="onSelectedRecurringChanged($event)">
|
||||
<mat-option
|
||||
*ngFor="let recurring of recurringTypes" value="{{recurring.Code}}"
|
||||
>
|
||||
{{recurring.Description}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="selectedRecurringType != '-1'" class="container-div width-100">
|
||||
<div class="ion-item-class-2">
|
||||
<div *ngIf="postEvent.EventRecurrence.Type != '-1'" class="container-div width-100">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-datetime
|
||||
placeholder="Última ocorrência"
|
||||
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
||||
displayFormat="DD MMM YYYY"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
max="2045"
|
||||
>
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input> -->
|
||||
<div (click)="openLastOccurrence()" class="ion-input-class flex-grow-1">
|
||||
<mat-form-field class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="occurrrence"
|
||||
placeholder="Choose a date"
|
||||
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #occurrrence
|
||||
[showSpinners]="showSpinners"
|
||||
[showSeconds]="showSeconds"
|
||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||
[stepSecond]="stepSecond"
|
||||
[touchUi]="touchUi"
|
||||
>
|
||||
</ngx-mat-datetime-picker>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -218,15 +239,9 @@
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label *ngIf="taskParticipants?.length < 1" class="list-people-title">Adicionar intervenientes*</ion-label>
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label *ngFor="let participant of taskParticipants">{{participant.Name}}</ion-label>
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
</ion-list>
|
||||
<ion-label *ngIf="taskParticipants?.length < 1" class="list-people-title">Adicionar intervenientes*</ion-label>
|
||||
<ion-label *ngFor="let participant of taskParticipants">{{participant.Name}}</ion-label>
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="add-people cursor-pointer">
|
||||
@@ -246,15 +261,9 @@
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Com conhecimento</ion-label>
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
</ion-list>
|
||||
<ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Com conhecimento</ion-label>
|
||||
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="add-people cursor-pointer">
|
||||
|
||||
@@ -16,7 +16,7 @@ ion-content{
|
||||
padding: 30px 20px 0px 20px;
|
||||
color:#000;
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
|
||||
.title-content{
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
@@ -59,7 +59,7 @@ ion-content{
|
||||
}
|
||||
.container-div{
|
||||
margin-bottom: 15px;
|
||||
overflow: auto;
|
||||
//overflow: auto;
|
||||
}
|
||||
.ion-item-class-2{
|
||||
display: flex;
|
||||
@@ -91,9 +91,9 @@ ion-content{
|
||||
flex: 1;
|
||||
}
|
||||
.list-people{
|
||||
width: 256px;
|
||||
width: 250px;
|
||||
float: left;
|
||||
|
||||
|
||||
}
|
||||
.add-people{
|
||||
width: 45px;
|
||||
@@ -154,7 +154,7 @@ ion-content{
|
||||
--color:#ffffff;
|
||||
margin:10px;
|
||||
}
|
||||
|
||||
|
||||
.text-input{
|
||||
width: 100%;
|
||||
border: 1px solid #ebebeb;
|
||||
@@ -162,7 +162,7 @@ ion-content{
|
||||
padding: 0 !important;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
|
||||
/* Error Messages */
|
||||
.error{
|
||||
color:red;
|
||||
@@ -178,7 +178,7 @@ ion-content{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.app-name{
|
||||
background: var(--title-text-color);
|
||||
border-radius: 18px;
|
||||
@@ -195,8 +195,8 @@ ion-content{
|
||||
-ms-border-radius: 18px;
|
||||
-o-border-radius: 18px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.close-button {
|
||||
display: none;
|
||||
height: 20px;
|
||||
@@ -215,4 +215,4 @@ ion-content{
|
||||
}
|
||||
.icon-time{
|
||||
color: #797979b0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,13 +15,28 @@ import { SearchPage } from '../../search/search.page';
|
||||
import { ThemePalette } from '@angular/material/core';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { EventRecurrence } from 'src/app/models/agenda/eventrecurrence.model';
|
||||
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-new-event',
|
||||
templateUrl: './new-event.page.html',
|
||||
styleUrls: ['./new-event.page.scss'],
|
||||
providers: [
|
||||
{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },
|
||||
]
|
||||
})
|
||||
|
||||
export class NewEventPage implements OnInit {
|
||||
@@ -61,6 +76,14 @@ export class NewEventPage implements OnInit {
|
||||
members:any;
|
||||
CalendarName;
|
||||
|
||||
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];
|
||||
|
||||
autoStartTime;
|
||||
autoEndTime;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
@@ -82,8 +105,21 @@ export class NewEventPage implements OnInit {
|
||||
this.selectedDate = this.navParams.get('eventSelectedDate');
|
||||
this.taskParticipants = this.navParams.get('attendees');
|
||||
|
||||
this.postEvent.StartDate = new Date()
|
||||
this.postEvent.EndDate = (new Date(new Date().getTime() + 15 * 60000))
|
||||
let now = new Date();
|
||||
|
||||
if(now.getMinutes() <= 30){
|
||||
this.autoStartTime = new Date(now.setMinutes(30));
|
||||
this.postEvent.StartDate = this.autoStartTime;
|
||||
this.autoEndTime = new Date(this.autoStartTime.getTime() + 30 * 60000);
|
||||
this.postEvent.EndDate = this.autoEndTime;
|
||||
}
|
||||
else{
|
||||
this.autoStartTime = new Date(now.setHours(now.getHours()+1));
|
||||
this.autoStartTime = new Date(this.autoStartTime.setMinutes(0));
|
||||
this.postEvent.StartDate = this.autoStartTime;
|
||||
this.autoEndTime = new Date(this.autoStartTime.getTime() + 30 * 60000);
|
||||
this.postEvent.EndDate = this.autoEndTime;
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -91,16 +127,11 @@ export class NewEventPage implements OnInit {
|
||||
this.CalendarName = this.loggeduser.Profile;
|
||||
this.selectedRecurringType = "-1";
|
||||
console.log(this.postEvent);
|
||||
console.log(this.selectedSegment);
|
||||
|
||||
|
||||
this.getRecurrenceTypes();
|
||||
|
||||
/* console.log(this.profile); */
|
||||
|
||||
let selectedStartdDate = this.selectedDate;
|
||||
let selectedEndDate = new Date(this.selectedDate);
|
||||
/* Set + 30minutes to seleted datetime */
|
||||
selectedEndDate.setMinutes(this.selectedDate.getMinutes() + 30) ;
|
||||
|
||||
if(this.selectedSegment != "Combinada"){
|
||||
this.postEvent ={
|
||||
EventId: '',
|
||||
@@ -108,9 +139,9 @@ export class NewEventPage implements OnInit {
|
||||
Body: this.eventBody,
|
||||
Location: '',
|
||||
CalendarId: '',
|
||||
CalendarName: '',
|
||||
StartDate: selectedStartdDate,
|
||||
EndDate: new Date(selectedEndDate),
|
||||
CalendarName: 'Oficial',
|
||||
StartDate: this.autoStartTime,
|
||||
EndDate: this.autoEndTime,
|
||||
EventType: 'Reunião',
|
||||
Attendees: null,
|
||||
IsMeeting: false,
|
||||
@@ -120,7 +151,7 @@ export class NewEventPage implements OnInit {
|
||||
Organizer: '',
|
||||
Category: 'Reunião',
|
||||
HasAttachments: false,
|
||||
EventRecurrence: {Type:'-1'},
|
||||
EventRecurrence: {Type:'-1',LastOccurrence:this.autoEndTime},
|
||||
};
|
||||
}
|
||||
else{
|
||||
@@ -131,8 +162,8 @@ export class NewEventPage implements OnInit {
|
||||
Location: '',
|
||||
CalendarId: '',
|
||||
CalendarName: 'Oficial',
|
||||
StartDate: selectedStartdDate,
|
||||
EndDate: new Date(selectedEndDate),
|
||||
StartDate: this.autoStartTime,
|
||||
EndDate: this.autoEndTime,
|
||||
EventType: 'Reunião',
|
||||
Attendees: null,
|
||||
IsMeeting: false,
|
||||
@@ -142,7 +173,7 @@ export class NewEventPage implements OnInit {
|
||||
Organizer: '',
|
||||
Category: 'Reunião',
|
||||
HasAttachments: false,
|
||||
EventRecurrence: {Type:'-1'},
|
||||
EventRecurrence: {Type:'-1',LastOccurrence:this.autoEndTime},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -224,6 +255,28 @@ export class NewEventPage 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()
|
||||
}
|
||||
}
|
||||
|
||||
async save() {
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
@@ -98,7 +98,9 @@ export class NewEventPage implements OnInit {
|
||||
@ViewChild('picker1') picker1: any;
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
validateFrom = false;
|
||||
autoStartTime;
|
||||
autoEndTime;
|
||||
|
||||
public options = [
|
||||
{ value: true, label: 'True' },
|
||||
@@ -129,8 +131,22 @@ export class NewEventPage implements OnInit {
|
||||
this.loggeduser = userService.ValidatedUser;
|
||||
this.postEvent = new Event();
|
||||
|
||||
this.postEvent.StartDate = new Date()
|
||||
this.postEvent.EndDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
let now = new Date();
|
||||
|
||||
if(now.getMinutes() <= 30){
|
||||
this.autoStartTime = new Date(now.setMinutes(30));
|
||||
this.postEvent.StartDate = this.autoStartTime;
|
||||
this.autoEndTime = new Date(this.autoStartTime.getTime() + 30 * 60000);
|
||||
this.postEvent.EndDate = this.autoEndTime;
|
||||
}
|
||||
else{
|
||||
this.autoStartTime = new Date(now.setHours(now.getHours()+1));
|
||||
this.autoStartTime = new Date(this.autoStartTime.setMinutes(0));
|
||||
this.postEvent.StartDate = this.autoStartTime;
|
||||
this.autoEndTime = new Date(this.autoStartTime.getTime() + 30 * 60000);
|
||||
this.postEvent.EndDate = this.autoEndTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -143,14 +159,6 @@ export class NewEventPage implements OnInit {
|
||||
this.eventBody = { BodyType : "1", Text : ""};
|
||||
this.postEvent.Body = this.eventBody;
|
||||
|
||||
/* console.log(this.profile); */
|
||||
|
||||
let selectedStartdDate = this.selectedDate;
|
||||
let selectedEndDate = new Date(this.selectedDate);
|
||||
/* Set + 30minutes to seleted datetime */
|
||||
selectedEndDate.setMinutes(this.selectedDate.getMinutes() + 30) ;
|
||||
|
||||
|
||||
if(this.selectedSegment != "Combinada"){
|
||||
this.postEvent ={
|
||||
EventId: '',
|
||||
@@ -159,8 +167,8 @@ export class NewEventPage implements OnInit {
|
||||
Location: '',
|
||||
CalendarId: '',
|
||||
CalendarName: 'Oficial',
|
||||
StartDate: selectedStartdDate,
|
||||
EndDate: new Date(selectedEndDate),
|
||||
StartDate: this.autoStartTime,
|
||||
EndDate: this.autoEndTime,
|
||||
EventType: 'Reunião',
|
||||
Attendees: null,
|
||||
IsMeeting: false,
|
||||
@@ -170,7 +178,7 @@ export class NewEventPage implements OnInit {
|
||||
Organizer: '',
|
||||
Category: 'Reunião',
|
||||
HasAttachments: false,
|
||||
EventRecurrence: {Type:'-1'},
|
||||
EventRecurrence: {Type:'-1',LastOccurrence:this.autoEndTime},
|
||||
};
|
||||
}
|
||||
else{
|
||||
@@ -181,8 +189,8 @@ export class NewEventPage implements OnInit {
|
||||
Location: '',
|
||||
CalendarId: '',
|
||||
CalendarName: 'Oficial',
|
||||
StartDate: selectedStartdDate,
|
||||
EndDate: new Date(selectedEndDate),
|
||||
StartDate: this.autoStartTime,
|
||||
EndDate: this.autoEndTime,
|
||||
EventType: 'Reunião',
|
||||
Attendees: null,
|
||||
IsMeeting: false,
|
||||
@@ -192,7 +200,7 @@ export class NewEventPage implements OnInit {
|
||||
Organizer: '',
|
||||
Category: 'Reunião',
|
||||
HasAttachments: false,
|
||||
EventRecurrence: {Type:'-1'},
|
||||
EventRecurrence: {Type:'-1',LastOccurrence:this.autoEndTime},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user