Added reset of ts.minutes inside addMinutesToTimestamp function
parent
358b3bf4fc
commit
8b75a185a2
|
@ -1,5 +1,5 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const writer = std.io.getStdOut().writer(); //rausnehmen
|
const writer = std.io.getStdOut().writer();
|
||||||
|
|
||||||
|
|
||||||
const Timestamp = struct {
|
const Timestamp = struct {
|
||||||
|
@ -55,10 +55,11 @@ pub fn addMinutesToTimestamp(ts: *Timestamp, min: u16) !void{
|
||||||
if ((addMinutes + ts.minutes) >= 60){
|
if ((addMinutes + ts.minutes) >= 60){
|
||||||
addMinutes = (addMinutes + ts.minutes)%60;
|
addMinutes = (addMinutes + ts.minutes)%60;
|
||||||
addHours += 1;
|
addHours += 1;
|
||||||
|
ts.minutes = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ts.hours += addHours;
|
ts.hours += addHours;
|
||||||
ts.hours += addMinutes;
|
ts.minutes += addMinutes;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue