NBloodServerSupervisor/WebInterface/Models/HomeViewModel.cs

23 lines
659 B
C#
Raw Normal View History

2020-01-27 14:48:53 +01:00
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);
}
}
}