Made TimeType selector in modal respond to last entry
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "WorkTime",
|
"name": "WorkTime",
|
||||||
"version": "0.0.1",
|
"version": "1.1",
|
||||||
"author": "Ionic Framework",
|
"author": "Ionic Framework",
|
||||||
"homepage": "https://ionicframework.com/",
|
"homepage": "https://ionicframework.com/",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -62,4 +62,4 @@
|
|||||||
"typescript": "~5.4.0"
|
"typescript": "~5.4.0"
|
||||||
},
|
},
|
||||||
"description": "An Ionic project"
|
"description": "An Ionic project"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
</ion-modal>
|
</ion-modal>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-select label="Stempeltyp" value="login" cancel-text="Abbrechen" [(ngModel)]="modalMode">
|
<ion-select label="Stempeltyp" value="login" cancel-text="Abbrechen" [(ngModel)]="currentAction">
|
||||||
<ion-select-option value="login">Einstempeln</ion-select-option>
|
<ion-select-option value="login">Einstempeln</ion-select-option>
|
||||||
<ion-select-option value="logout">Ausstempeln</ion-select-option>
|
<ion-select-option value="logout">Ausstempeln</ion-select-option>
|
||||||
<ion-select-option value="start-drive">Dienstreise starten</ion-select-option>
|
<ion-select-option value="start-drive">Dienstreise starten</ion-select-option>
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ export class TimePage {
|
|||||||
@ViewChild('createModal') modal: IonModal | undefined;
|
@ViewChild('createModal') modal: IonModal | undefined;
|
||||||
|
|
||||||
public modalDate: any;
|
public modalDate: any;
|
||||||
public modalMode: TimeType = 'login';
|
|
||||||
public currentDate: any;
|
public currentDate: any;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
@@ -127,7 +126,7 @@ export class TimePage {
|
|||||||
|
|
||||||
this.data.push({
|
this.data.push({
|
||||||
registeredAt: date,
|
registeredAt: date,
|
||||||
type: this.modalMode
|
type: this.currentAction
|
||||||
});
|
});
|
||||||
this.data.sort((a: TimeEntry, b: TimeEntry) => {
|
this.data.sort((a: TimeEntry, b: TimeEntry) => {
|
||||||
return a.registeredAt.getTime() - b.registeredAt.getTime();
|
return a.registeredAt.getTime() - b.registeredAt.getTime();
|
||||||
@@ -138,8 +137,10 @@ export class TimePage {
|
|||||||
this.shouldAnimate.push(false);
|
this.shouldAnimate.push(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.updateCurrentAction();
|
||||||
this.saveData();
|
this.saveData();
|
||||||
this.modal?.dismiss(null, 'submit');
|
this.modal?.dismiss(null, 'submit');
|
||||||
|
this.modalDate = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
public isToday(): boolean {
|
public isToday(): boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user