Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #107 from leaphy-robotics/106-serial-naar-csv-vera…
Browse files Browse the repository at this point in the history
…nder-kolommen

fix: split CSV datetime column into separate date and time columns
  • Loading branch information
JeftadeGraaf authored Jan 21, 2024
2 parents 47151fb + 800c3f8 commit add0975
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ export class SerialOutputComponent implements AfterViewInit, OnInit {

private subscribeToSerialData() {
interface SerialData {
date: Date;
time: Date;
data: string;
}

this.serialDataSubscription = this.robotWiredState.serialData$.subscribe((data: SerialData[]) => {
this.serialDataAsJSON = data.map(item => ({ time: item.time, data: item.data.trim() }));
this.serialDataAsJSON = data.map(item => ({date:item.time.toLocaleDateString(), time: item.time.toLocaleTimeString(), data: item.data.trim() }));
});
}

Expand Down

0 comments on commit add0975

Please sign in to comment.