Skip to content

Commit

Permalink
Move dates string to code behind
Browse files Browse the repository at this point in the history
  • Loading branch information
codemonkey85 committed Nov 5, 2024
1 parent 44e7a9b commit b315d30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion AboutMe/Wasm/Pages/Resume.razor
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
@job.Company
</MudText>
<MudText Typo="@Typo.body2">
@($"{job.StartDate:MMM yyyy} - {(job.EndDate is null ? "Present" : $"{job.EndDate:MMM yyyy}")} {(job.YearsAtJob > 0 ? $"({job.YearsAtJob} year{(job.YearsAtJob == 1 ? string.Empty : "s")})" : string.Empty)}")
@job.DatesString
</MudText>
</MudStack>
</MudCardHeader>
Expand Down
3 changes: 3 additions & 0 deletions AboutMe/Wasm/Pages/Resume.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@ private readonly struct Job
PresentlyEmployed || EndDate is null
? (DateTime.Now - StartDate).Days / 365
: (EndDate.Value - StartDate).Days / 365;

public string DatesString =>
$"{StartDate:MMM yyyy} - {(EndDate is null ? "Present" : $"{EndDate:MMM yyyy}")} {(YearsAtJob > 0 ? $"({YearsAtJob} year{(YearsAtJob == 1 ? string.Empty : "s")})" : string.Empty)}";
}

private readonly struct Duty
Expand Down

0 comments on commit b315d30

Please sign in to comment.