Compare commits
No commits in common. "7b691f3f9ae9c9ece16ef582c7f51f9a9d1f522d" and "52e8b1aa89bf8d76f5a5c7d17858de30f03c7d7c" have entirely different histories.
7b691f3f9a
...
52e8b1aa89
|
@ -110,9 +110,6 @@
|
|||
}
|
||||
},
|
||||
"cli": {
|
||||
"schematicCollections": [
|
||||
"@angular-eslint/schematics"
|
||||
],
|
||||
"analytics": false
|
||||
"schematicCollections": ["@angular-eslint/schematics"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11119,8 +11119,7 @@
|
|||
"node_modules/iban": {
|
||||
"version": "0.0.14",
|
||||
"resolved": "https://registry.npmjs.org/iban/-/iban-0.0.14.tgz",
|
||||
"integrity": "sha512-+rocNKk+Ga9m8Lr9fTMWd+87JnsBrucm0ZsIx5ROOarZlaDLmd+FKdbtvb0XyoBw9GAFOYG2GuLqoNB16d+p3w==",
|
||||
"peer": true
|
||||
"integrity": "sha512-+rocNKk+Ga9m8Lr9fTMWd+87JnsBrucm0ZsIx5ROOarZlaDLmd+FKdbtvb0XyoBw9GAFOYG2GuLqoNB16d+p3w=="
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
|
@ -27454,8 +27453,7 @@
|
|||
"iban": {
|
||||
"version": "0.0.14",
|
||||
"resolved": "https://registry.npmjs.org/iban/-/iban-0.0.14.tgz",
|
||||
"integrity": "sha512-+rocNKk+Ga9m8Lr9fTMWd+87JnsBrucm0ZsIx5ROOarZlaDLmd+FKdbtvb0XyoBw9GAFOYG2GuLqoNB16d+p3w==",
|
||||
"peer": true
|
||||
"integrity": "sha512-+rocNKk+Ga9m8Lr9fTMWd+87JnsBrucm0ZsIx5ROOarZlaDLmd+FKdbtvb0XyoBw9GAFOYG2GuLqoNB16d+p3w=="
|
||||
},
|
||||
"iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes, provideRouter, withComponentInputBinding } from '@angular/router';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { StudentListComponent } from './components/students/student-list/student-list.component';
|
||||
import { VisitsComponent } from './components/visits/visits.component';
|
||||
import { VisitsDatetimeComponent } from './components/visits/visits-datetime/visits-datetime.component';
|
||||
|
@ -17,6 +17,5 @@ const routes: Routes = [
|
|||
@NgModule({
|
||||
imports: [RouterModule.forRoot(routes)],
|
||||
exports: [RouterModule],
|
||||
providers: [provideRouter(routes, withComponentInputBinding())]
|
||||
})
|
||||
export class AppRoutingModule {}
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<div class="grid-item">
|
||||
<h1>{{ courseVisit?.name }}</h1>
|
||||
<h2>
|
||||
{{ courseVisit.date | date: 'dd.MM.yyyy' }}, {{ courseVisit.begin }} -
|
||||
{{ courseVisit.end }}
|
||||
{{ courseVisit?.date | date: 'dd.MM.yyyy' }}, {{ courseVisit?.begin }} -
|
||||
{{ courseVisit?.end }}
|
||||
</h2>
|
||||
<button class="button-add" (click)="add()">Hinzufügen</button>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { formatDate } from '@angular/common';
|
||||
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
@ -16,17 +16,14 @@ import { VisitsService } from 'src/app/services/visits/visits.service';
|
|||
templateUrl: './visits.component.html',
|
||||
styleUrls: ['./visits.component.scss'],
|
||||
})
|
||||
export class VisitsComponent implements OnInit {
|
||||
@Input()
|
||||
public date!: string;
|
||||
@Input()
|
||||
public time!: string;
|
||||
|
||||
export class VisitsComponent implements OnInit, OnDestroy {
|
||||
public loading: boolean = true;
|
||||
public courseVisit?: CourseVisit;
|
||||
public dataSource = new MatTableDataSource<StudentVisit>();
|
||||
|
||||
public addedStudent?: Student;
|
||||
|
||||
private routerSubscription?: Subscription;
|
||||
private courseDate: Date = new Date();
|
||||
|
||||
public constructor(
|
||||
|
@ -36,17 +33,26 @@ export class VisitsComponent implements OnInit {
|
|||
) {}
|
||||
|
||||
public ngOnInit() {
|
||||
if (this.date?.length == 8 && this.time?.length >= 3) {
|
||||
const fulltime = this.time.padStart(4, '0');
|
||||
const datetime = `${this.date.substring(0, 4)}-${this.date.substring(4, 6)}-${this.date.substring(6, 8)} ${fulltime.substring(0, 2)}:${fulltime.substring(2, 4)}:00`;
|
||||
this.routerSubscription = this.route.params.subscribe(params => {
|
||||
const date: string = params['date'];
|
||||
const time: string = params['time'];
|
||||
|
||||
const dateobj = new Date(datetime);
|
||||
if (dateobj) {
|
||||
this.courseDate = dateobj;
|
||||
if (date?.length == 8 && time?.length >= 3) {
|
||||
const fulltime = time.padStart(4, '0');
|
||||
const datetime = `${date.substring(0, 4)}-${date.substring(4, 6)}-${date.substring(6, 8)} ${fulltime.substring(0, 2)}:${fulltime.substring(2, 4)}:00`;
|
||||
|
||||
const dateobj = new Date(datetime);
|
||||
if (dateobj) {
|
||||
this.courseDate = dateobj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.getData();
|
||||
this.getData();
|
||||
});
|
||||
}
|
||||
|
||||
public ngOnDestroy() {
|
||||
this.routerSubscription?.unsubscribe();
|
||||
}
|
||||
|
||||
public visit(studentVisit: StudentVisit): void {
|
||||
|
|
Loading…
Reference in New Issue