NBloodServerSupervisor/WebInterface/Models/HomeViewModel.cs
2020-01-27 13:48:53 +00:00

23 lines
659 B
C#

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
namespace WebInterface
{
public class HomeViewModel
{
public IEnumerable<Server> Servers { get; }
public string RunningSinceUtc { get; }
public string ManHoursPlayed { get; }
public HomeViewModel(IEnumerable<Server> servers, DateTime runningSinceUtc, int manHoursPlayed)
{
Servers = servers;
RunningSinceUtc = runningSinceUtc.ToString("r");
ManHoursPlayed = (manHoursPlayed / 60f).ToString("n2", CultureInfo.InvariantCulture);
}
}
}