DatePicker - fixed errors rgearding variable name changes

pull/12/head
markosteger 2 years ago committed by Matija Koželj
parent 978dd7ad85
commit b3bc1fd2e2

@ -3,16 +3,16 @@
{ {
<div id="picker" class="m-2" style="width:270px; height:auto;"> <div id="picker" class="m-2" style="width:270px; height:auto;">
<!-- DatePicker input !can be edited manualy --> <!-- DatePicker input !can be edited manualy -->
<div class="inline-block"><input type="text" value="@Date.ToString(Format)" /><i class='bx bx-calendar' @onclick="(() => Shown = !Shown)"></i></div> <div class="inline-block"><input type="text" value="@SelectedDate.ToString(Format)" /><i class='bx bx-calendar' @onclick="(() => Shown = !Shown)"></i></div>
@if (Shown) @if (Shown)
{ {
<!-- DatePicker header --> <!-- DatePicker header -->
<div id="picker_header" class="bg-info" style="height:80px;"> <div id="picker_header" class="bg-info" style="height:80px;">
<div class="text-medium p-1"> <div class="text-medium p-1">
@Date.Year.ToString() @SelectedDate.Year.ToString()
</div> </div>
<div class="text-large p-1"> <div class="text-large p-1">
@Date.ToString("ddd, " + Format) @SelectedDate.ToString("ddd, " + Format)
</div> </div>
</div> </div>
<!-- DatePicker body --> <!-- DatePicker body -->
@ -23,10 +23,10 @@
{ {
<div class="@NavBarClass"> <div class="@NavBarClass">
<div class="d-inline-block p-2" style="width:10%;text-align:left"><i class='bx bx-chevron-left'></i></div> <div class="d-inline-block p-2" style="width:10%;text-align:left"><i class='bx bx-chevron-left'></i></div>
<div class="d-inline-block" style="width:70%;text-align:center" @onclick=@(()=>Selecting = Selecting.Months)>@Date.ToString("yyyy")</div> <div class="d-inline-block" style="width:70%;text-align:center" @onclick=@(()=>Selecting = Selecting.Months)>@SelectedDate.ToString("yyyy")</div>
<div class="d-inline-block p-2" style="width:10%;text-align:right"><i class='bx bx-chevron-right'></i></div> <div class="d-inline-block p-2" style="width:10%;text-align:right"><i class='bx bx-chevron-right'></i></div>
</div> </div>
@for (int i = Date.Year - 7; i < Date.Year + 8; i++) @for (int i = SelectedDate.Year - 7; i < SelectedDate.Year + 8; i++)
{ {
int y = i; int y = i;
<a href="#" @onclick="@(()=>SetYear(y))"> <a href="#" @onclick="@(()=>SetYear(y))">
@ -37,7 +37,7 @@
</div> </div>
</a> </a>
if (Date.Year - i % 3 == 0) if (SelectedDate.Year - i % 3 == 0)
{ {
<br /> <br />
} }
@ -48,7 +48,7 @@
{ {
<div class="@NavBarClass"> <div class="@NavBarClass">
<div class="d-inline-block p-2" style="width:10%;text-align:left"><i class='bx bx-chevron-left'></i></div> <div class="d-inline-block p-2" style="width:10%;text-align:left"><i class='bx bx-chevron-left'></i></div>
<div class="d-inline-block" style="width:70%;text-align:center" @onclick=@(()=>Selecting = Selecting.Years)>@Date.ToString("MMMM yyyy")</div> <div class="d-inline-block" style="width:70%;text-align:center" @onclick=@(()=>Selecting = Selecting.Years)>@SelectedDate.ToString("MMMM yyyy")</div>
<div class="d-inline-block p-2" style="width:10%;text-align:right"><i class='bx bx-chevron-right'></i></div> <div class="d-inline-block p-2" style="width:10%;text-align:right"><i class='bx bx-chevron-right'></i></div>
</div> </div>
@for (int i = 1; i <= @DateTimeFormatInfo.CurrentInfo.MonthNames.Length - 1; i++) @for (int i = 1; i <= @DateTimeFormatInfo.CurrentInfo.MonthNames.Length - 1; i++)
@ -74,27 +74,27 @@
{ {
<div class="@NavBarClass"> <div class="@NavBarClass">
<div class="d-inline-block p-2" style="width:10%;text-align:left"><i class='bx bx-chevron-left'></i></div> <div class="d-inline-block p-2" style="width:10%;text-align:left"><i class='bx bx-chevron-left'></i></div>
<div class="d-inline-block" style="width:70%;text-align:center" @onclick=@(()=>Selecting = Selecting.Months)>@Date.ToString("MMMM yyyy")</div> <div class="d-inline-block" style="width:70%;text-align:center" @onclick=@(()=>Selecting = Selecting.Months)>@SelectedDate.ToString("MMMM yyyy")</div>
<div class="d-inline-block p-2" style="width:10%;text-align:right"><i class='bx bx-chevron-right'></i></div> <div class="d-inline-block p-2" style="width:10%;text-align:right"><i class='bx bx-chevron-right'></i></div>
</div> </div>
@for (int i = 0; i < 7; i++) @for (int i = 0; i < 7; i++)
{ {
<div class="@DayNamesRowClass" style="width:30px; height:30px; text-align:center; padding-top:5px;">@calendarStart.AddDays(i).ToString("ddd")</div> <div class="@DayNamesRowClass" style="width:30px; height:30px; text-align:center; padding-top:5px;">@CalendarStart.AddDays(i).ToString("ddd")</div>
} }
@foreach (var Date in Dates) @foreach (var Date in ShowingDates)
{ {
<a href="#" @onclick="@(()=>SetDate(Date))"> <a href="#" @onclick="@(()=>SetDate(Date))">
<div class="chip-leading-icon d-inline-block p-1 m-1 @DateChipStyle(Date)" style="width:30px; height:30px; text-align:center"> <div class="chip-leading-icon d-inline-block p-1 m-1 @DateChipStyle(Date)" style="width:30px; height:30px; text-align:center">
@Date.Day.ToString() @Date.Day.ToString()
</div> </div>
</a> </a>
@if (calendarStart.DayOfWeek.Equals(DayOfWeek.Sunday)) @if (CalendarStart.DayOfWeek.Equals(DayOfWeek.Sunday))
{ {
<br /> <br />
} }
calendarStart = calendarStart.AddDays(1); CalendarStart = CalendarStart.AddDays(1);
} }
break; break;
} }

Loading…
Cancel
Save