de7e742731
- aggiunta nuova path e rename
60 lines
1.5 KiB
C#
60 lines
1.5 KiB
C#
namespace EgwCoreLib.BlazorTest.Pages
|
|
{
|
|
public partial class TestCal
|
|
{
|
|
#region Protected Methods
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
dtCurr = DateTime.Today;
|
|
await Task.Delay(1);
|
|
DateCheck = new Dictionary<DateTime, string>();
|
|
Random rnd = new Random();
|
|
// random colorate...
|
|
for (int i = 0; i < 10; i++)
|
|
{
|
|
DateTime newDate = dtCurr.AddDays(rnd.Next(-5, 10)).Date;
|
|
if (!DateCheck.ContainsKey(newDate))
|
|
{
|
|
DateCheck.Add(newDate, "bg-success text-light rounded-circle p-2");
|
|
}
|
|
else
|
|
{
|
|
DateCheck[newDate] = "bg-warning text-light rounded-circle p-2";
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Fields
|
|
|
|
private Dictionary<DateTime, string> DateCheck = new Dictionary<DateTime, string>();
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Private Properties
|
|
|
|
private DateTime dtCurr { get; set; } = DateTime.Today;
|
|
|
|
private bool singleWeek = false;
|
|
|
|
#endregion Private Properties
|
|
|
|
#region Private Methods
|
|
|
|
private void DisplayDate(DateTime dtSel)
|
|
{
|
|
dtCurr = dtSel;
|
|
singleWeek= true;
|
|
}
|
|
|
|
private async Task resetCal()
|
|
{
|
|
singleWeek = false;
|
|
await Task.Delay(1);
|
|
}
|
|
|
|
#endregion Private Methods
|
|
}
|
|
} |