Skip to content

Commit

Permalink
Fix time frame label (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvain-guillet authored Aug 28, 2024
1 parent ecea5aa commit 1e1c8ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace IO.Astrodynamics.TimeSystem.Frames;

public class LocalTimeFrame : TimeFrame
{
internal LocalTimeFrame() : base(string.Empty)
internal LocalTimeFrame() : base("Local")
{
}

Expand All @@ -21,4 +21,9 @@ public override Time ConvertFromTAI(Time time)
var epoch = DateTime.SpecifyKind(time.DateTime - leaps, DateTimeKind.Utc).ToLocalTime();
return new TimeSystem.Time(epoch, LocalFrame);
}

public override string ToString()
{
return string.Empty;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace IO.Astrodynamics.TimeSystem.Frames;

public class UTCTimeFrame : TimeFrame
{
internal UTCTimeFrame() : base(string.Empty)
internal UTCTimeFrame() : base("UTC")
{
}

Expand All @@ -19,4 +19,9 @@ public override Time ConvertFromTAI(Time time)
var leaps = this.LeapSecondsFrom(time);
return new TimeSystem.Time(time.DateTime - leaps, UTCFrame);
}

public override string ToString()
{
return string.Empty;
}
}
2 changes: 1 addition & 1 deletion IO.Astrodynamics.Net/IO.Astrodynamics/TimeSystem/Time.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public Time ToLocal()
public override string ToString()
{
string suffix = string.Empty;
if (!string.IsNullOrEmpty(Frame.Name))
if (!string.IsNullOrEmpty(this.Frame.ToString()))
{
suffix = " " + this.Frame.ToString();
}
Expand Down

0 comments on commit 1e1c8ad

Please sign in to comment.