-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tsuki_kamI_
committed
May 3, 2024
1 parent
c3b78f4
commit 0649507
Showing
15 changed files
with
2,750 additions
and
183 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/app/main/search/station-detail/station-detail.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>timetable works!</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { TimetableComponent } from './timetable.component'; | ||
|
||
describe('TimetableComponent', () => { | ||
let component: TimetableComponent; | ||
let fixture: ComponentFixture<TimetableComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [TimetableComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(TimetableComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import {Component, Input} from '@angular/core'; | ||
import {convertToModel, Timetable} from "../../../models/result.TimeTable.Plan"; | ||
import {DbService} from "../../../services/db.service"; | ||
import {Station} from "../../../models/result.StationData.Stations"; | ||
|
||
@Component({ | ||
selector: 'app-timetable', | ||
templateUrl: './timetable.component.html', | ||
styleUrl: './timetable.component.css' | ||
}) | ||
export class TimetableComponent { | ||
@Input() station: Station; | ||
|
||
constructor( | ||
private dbService: DbService | ||
) { | ||
} | ||
|
||
getTimeTable(station: Station) { | ||
const now = new Date(); | ||
const year = now.getUTCFullYear().toString().slice(-2); // Get last two digits of year | ||
const month = (now.getUTCMonth() + 1).toString().padStart(2, '0'); // Months are 0-indexed in JavaScript | ||
const date = now.getUTCDate().toString().padStart(2, '0'); | ||
const hour = now.getUTCHours().toString().padStart(2, '0'); | ||
const formattedDate = year + month + date; | ||
const formattedHour = hour; | ||
this.dbService.getTimeTablesPlan( | ||
station.evaNumbers[0].number.toString(), | ||
formattedDate, | ||
formattedHour, | ||
true, | ||
false) | ||
.subscribe((value: any) => { | ||
const timetable: Timetable = convertToModel(value?.data?.timetable); | ||
}); | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.