Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

Commit

Permalink
Merge pull request FritzAndFriends#13 from FritzAndFriends/revert-12-…
Browse files Browse the repository at this point in the history
…feature_ScheduleUI

Revert "Initial schedule UI"
  • Loading branch information
csharpfritz authored Jun 18, 2019
2 parents 11c27c5 + 4c8dbef commit 720ce65
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 133 deletions.
55 changes: 18 additions & 37 deletions src/Fritz.ResourceManagement.Web/Components/DayPicker.razor
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
<div class="monthpicker">

<button id="prevMonth" onclick="@PrevMonth">&lt;</button>
<div id="name">@StartDate.ToString("MMMM yyyy")</div>
<button id="nextMonth" onclick="@NextMonth">&gt;</button>

<span class="day">Su</span>
<span class="day">M</span>
<span class="day">Tu</span>
<span class="day">W</span>
<span class="day">Th</span>
<span class="day">F</span>
<span class="day">Sa</span>

@for (var i=0; i<FirstDayOfMonthDoW; i++)
{
<span></span>
}

@for (var i=1; i<=LastDayOfMonth; i++)
{
<span>@i</span>
}
<div style="width: 20em;">

<div id="navrow">
<button onclick="PrevMonth">&lt;</button>
<span>@StartDate.ToString("MMMMM")</span>
<button onclick="NextMonth">&gt;</button>
</div>
<div id="dowRow">
<span>Su</span>
<span>M</span>
<span>Tu</span>
<span>W</span>
<span>Th</span>
<span>F</span>
<span>Sa</span>
</div>

</div>

Expand All @@ -30,28 +23,16 @@
[Parameter]
DateTime StartDate { get; set; } = DateTime.Today;

int FirstDayOfMonthDoW { get {

var first = new DateTime(StartDate.Year, StartDate.Month, 1);
return (int)first.DayOfWeek;

} }

int LastDayOfMonth { get
{
return new DateTime(StartDate.Year, StartDate.Month, 1).AddMonths(1).AddDays(-1).Day;
} }

void PrevMonth()
{
StartDate = StartDate.AddMonths(-1);
StartDate = new DateTime(StartDate.Year, StartDate.Month, 1);
StartDate = StartDate.AddDays(DateTime.DaysInMonth(StartDate.Year, StartDate.Month));
}

void NextMonth()
{
StartDate = StartDate.AddMonths(1);
StartDate = new DateTime(StartDate.Year, StartDate.Month, 1);
StartDate = StartDate.AddDays(DateTime.DaysInMonth(StartDate.Year, StartDate.Month));
}

}
26 changes: 0 additions & 26 deletions src/Fritz.ResourceManagement.Web/Components/DayView.razor

This file was deleted.

15 changes: 2 additions & 13 deletions src/Fritz.ResourceManagement.Web/Pages/Availability.cshtml
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
@page
@using Fritz.ResourceManagement.Web.Components
@model Fritz.ResourceManagement.Web.Pages.AvailabilityModel
@{
ViewData["Title"] = "Availability";
}

<h1>Availability</h1>

<div id="Availability" style="display: inline-block">
@(await Html.RenderComponentAsync<Availability>())
<div id="Availability">
@(await Html.RenderComponentAsync<Fritz.ResourceManagement.Web.Components.Availability>())
</div>

<div id="MySchedule" style="display: inline-block">
<h3>My Schedule</h3>
@(await Html.RenderComponentAsync<DayPicker>())

@(await Html.RenderComponentAsync<DayView>(new { SelectedDate = DateTime.Today}))

</div>


Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"/>
</environment>
<link rel="stylesheet" href="~/css/site.css" />
<link rel="stylesheet" href="~/css/Schedule.css" />
</head>
<body>
<header>
Expand Down
56 changes: 0 additions & 56 deletions src/Fritz.ResourceManagement.Web/wwwroot/css/Schedule.css

This file was deleted.

0 comments on commit 720ce65

Please sign in to comment.