Addet employee frontend and move header to a componet
This commit is contained in:
33
PointOfSale/Pos.Web/Components/Shared/Header.razor.cs
Normal file
33
PointOfSale/Pos.Web/Components/Shared/Header.razor.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Globalization;
|
||||
|
||||
namespace Pos.Web.Components.Shared
|
||||
{
|
||||
public partial class Header
|
||||
{
|
||||
private readonly CultureInfo _danishCulture =
|
||||
CultureInfo.GetCultureInfo("da-DK");
|
||||
|
||||
private readonly Timer _timer;
|
||||
private DateTime _currentTime = DateTime.Now;
|
||||
|
||||
public Header()
|
||||
{
|
||||
_timer = new Timer(
|
||||
UpdateTime,
|
||||
null,
|
||||
TimeSpan.FromMinutes(1),
|
||||
TimeSpan.FromMinutes(1));
|
||||
}
|
||||
|
||||
private void UpdateTime(object? state)
|
||||
{
|
||||
_currentTime = DateTime.Now;
|
||||
_ = InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_timer.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user