Fix rilettura data machineBlock
This commit is contained in:
@@ -48,7 +48,7 @@ else
|
||||
<div class="card-body p-1" style="background-color: currentColor; background-image: linear-gradient(121deg, rgba(255, 255, 255, 0.20) -0.71%, rgba(255, 255, 255, 0.05) 97.66%); border-radius: 0 0 15px 15px">
|
||||
<div class="@RecMSE.Semaforo p-1" style="border-radius: .375rem">
|
||||
<div class="d-flex justify-content-center fs-5">
|
||||
<span><b>@RecMSE.DescrizioneStato</b>: @(formatDurata(RecMSE.Durata))</span>
|
||||
<span><b>@RecMSE.DescrizioneStato</b>: @(FormatDurata(RecMSE.Durata))</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
@@ -95,7 +95,7 @@ else
|
||||
<div class="fs-2" style="line-height: 1.8rem;">
|
||||
<b>@RecMSE.Nome</b>
|
||||
<br />
|
||||
<b>@RecMSE.DescrizioneStato</b>: @(formatDurata(RecMSE.Durata))
|
||||
<b>@RecMSE.DescrizioneStato</b>: @(FormatDurata(RecMSE.Durata))
|
||||
</div>
|
||||
</div>
|
||||
@if (showCard)
|
||||
@@ -241,7 +241,7 @@ else
|
||||
<b>@RecMSE.DescrizioneStato</b> :
|
||||
</div>
|
||||
<div class="p-0">
|
||||
@(formatDurata(RecMSE.Durata))
|
||||
@(FormatDurata(RecMSE.Durata))
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -41,27 +41,22 @@ namespace MP_TAB_SERV.Components
|
||||
/// </summary>
|
||||
/// <param name="minuti">minuti</param>
|
||||
/// <returns></returns>
|
||||
public static string formatDurata(double? minuti)
|
||||
public static string FormatDurata(double? minuti)
|
||||
{
|
||||
string answ = "??";
|
||||
if (minuti != null)
|
||||
TimeSpan tempo = TimeSpan.FromMinutes(minuti ?? 0);
|
||||
if (tempo.TotalMinutes < 60)
|
||||
{
|
||||
DateTime tempo = new DateTime();
|
||||
tempo = tempo.AddMinutes((double)minuti);
|
||||
if (minuti < 60)
|
||||
{
|
||||
answ = $"{tempo.Minute:00}:{tempo.Second:00}";
|
||||
}
|
||||
else if (minuti < 1440)
|
||||
{
|
||||
answ = $"{tempo.Hour}h {tempo.Minute}m";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = $"{tempo.DayOfYear}g {tempo.Hour}h";
|
||||
}
|
||||
answ = $"{tempo.Minutes:00}:{tempo.Seconds:00}";
|
||||
}
|
||||
else if (tempo.TotalHours < 24)
|
||||
{
|
||||
answ = $"{tempo.Hours}h {tempo.Minutes}m";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = $"{tempo.Days}g {tempo.Hours}h";
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user