Aggiunto LastYear

This commit is contained in:
Samuele Locatelli
2023-06-28 14:52:57 +02:00
parent 31244f325b
commit be80f179d7
3 changed files with 12 additions and 5 deletions
+1
View File
@@ -10,6 +10,7 @@
<option value="@item">@item</option>
}
</select>
<span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
</div>
+3 -3
View File
@@ -35,7 +35,7 @@ namespace EgwCoreLib.Razor
if (CurrPeriodo.Fine != value)
{
CurrPeriodo.Fine = value;
perSelect = $"{DtUtils.PeriodSet.Period}";
perSelect = $"{DtUtils.PeriodSet.Select}";
E_PeriodoSel.InvokeAsync(CurrPeriodo);
}
}
@@ -49,7 +49,7 @@ namespace EgwCoreLib.Razor
if (CurrPeriodo.Inizio != value)
{
CurrPeriodo.Inizio = value;
perSelect = $"{DtUtils.PeriodSet.Period}";
perSelect = $"{DtUtils.PeriodSet.Select}";
E_PeriodoSel.InvokeAsync(CurrPeriodo);
}
}
@@ -86,7 +86,7 @@ namespace EgwCoreLib.Razor
#region Private Properties
private DtUtils.Periodo currPeriodo { get; set; } = new DtUtils.Periodo();
private string perSelect { get; set; } = "Period";
private string perSelect { get; set; } = "Select";
#endregion Private Properties
}
+8 -2
View File
@@ -6,12 +6,13 @@
public enum PeriodSet
{
Period = 0,
Select = 0,
Today,
Yesterday,
LastMonth,
LastTrim,
LastWeek,
LastYear,
ThisMonth,
ThisTrim,
ThisWeek,
@@ -63,6 +64,11 @@
this.Inizio = this.Fine.AddMonths(-3);
break;
case DtUtils.PeriodSet.LastYear:
this.Inizio = new DateTime(oggi.Year-1, 1, 1);
this.Fine = new DateTime(oggi.Year , 1, 1);
break;
case DtUtils.PeriodSet.LastWeek:
this.Inizio = oggi.StartOfWeek(DayOfWeek.Monday).AddDays(-7);
this.Fine = this.Inizio.AddDays(7);
@@ -90,7 +96,7 @@
this.Fine = new DateTime(oggi.Year + 1, 1, 1);
break;
case DtUtils.PeriodSet.Period:
case DtUtils.PeriodSet.Select:
default:
break;
}