Skip to content

Commit

Permalink
chore(scheduler): final touches
Browse files Browse the repository at this point in the history
  • Loading branch information
ntacheva committed Dec 21, 2021
1 parent de42bb2 commit 9ccaa0f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scheduler/readonly-slots/ReadOnlySlots/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<style>
/*Use a variable for the readonly cells indexes and calculate it according to the application needs.
See CalculateReadOnlySlots(). */
div.k-scheduler-row:nth-of-type(@disabledStart),
div.k-scheduler-row:nth-of-type(@(disabledStart + 1)) {
div.k-scheduler-row:nth-of-type(@readOnlySlotIndex),
div.k-scheduler-row:nth-of-type(@(readOnlySlotIndex + 1)) {
background-color: #faecc8ff;
}
/*Keep the main cells white in case you don't want to color them. Otherwise, you will not need the style below.*/
Expand Down Expand Up @@ -48,7 +48,8 @@
public bool ValidAppt { get; set; }
public bool cancelValidate { get; set; }

public int disabledStart { get; set; }
public int readOnlySlotIndex { get; set; }
public int readOnlyStartHour { get; set; } = 12;

//display a dialog to notify the users they cannot set appointments in the desired time frame
async Task ShowErrorDialog()
Expand Down Expand Up @@ -179,9 +180,7 @@
//CSS rules.
async Task CalculateReadOnlySlots()
{
var disabledStartHour = 12;

disabledStart = ((disabledStartHour - DayStart.Hour) * SlotDivisions) + 1;
readOnlySlotIndex = ((readOnlyStartHour - DayStart.Hour) * SlotDivisions) + 1;
}

async Task GetSchedulerData()
Expand Down

0 comments on commit 9ccaa0f

Please sign in to comment.