Skip to content

Commit

Permalink
add dotnet 9
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Peugnet committed Nov 19, 2024
2 parents 80b3915 + 0abb543 commit 507fdf8
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 150 deletions.
3 changes: 2 additions & 1 deletion BlazorCalendar/MonthlyView.razor
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
if (TasksList is not null)
{
TasksList = TasksList.OrderBy(x => x.DateStart)
.ThenByDescending(x => x.DateEnd).ToArray();
.ThenByDescending(x => x.DateEnd)
.ToArray();
}
}

Expand Down
134 changes: 134 additions & 0 deletions BlazorCalendar/MonthlyView.razor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
.monthly-calendar {
display: grid;
width: 100%;
grid-template-rows: 6vh;
/*grid-template-columns: repeat(7, minmax(120px, 1fr));
grid-auto-rows: 120px;*/
grid-template-columns: repeat(7, minmax(8vw, 1fr));
grid-auto-rows: 12vh;
overflow: auto;
}

.monthly-day {
border-bottom: 1px solid rgba(166, 168, 179, 0.12);
border-right: 1px solid rgba(166, 168, 179, 0.12);
text-align: right;
padding: 0.4vh 0.4vw;
letter-spacing: 1px;
font-size: 0.8em;
box-sizing: border-box;
color: #6d7377;
position: relative;
}

.monthly-day:nth-of-type(n + 1):nth-of-type(-n + 7) {
grid-row: 2;
}

.monthly-day:nth-of-type(n + 8):nth-of-type(-n + 14) {
grid-row: 3;
}

.monthly-day:nth-of-type(n + 15):nth-of-type(-n + 21) {
grid-row: 4;
}

.monthly-day:nth-of-type(n + 22):nth-of-type(-n + 28) {
grid-row: 5;
}

.monthly-day:nth-of-type(n + 29):nth-of-type(-n + 35) {
grid-row: 6;
}

.monthly-day:nth-of-type(n + 36):nth-of-type(-n + 43) {
grid-row: 7;
}

.monthly-day:nth-of-type(7n + 1) {
grid-column: 1/1;
}

.monthly-day:nth-of-type(7n + 2) {
grid-column: 2/2;
}

.monthly-day:nth-of-type(7n + 3) {
grid-column: 3/3;
}

.monthly-day:nth-of-type(7n + 4) {
grid-column: 4/4;
}

.monthly-day:nth-of-type(7n + 5) {
grid-column: 5/5;
}

.monthly-day:nth-of-type(7n + 6) {
grid-column: 6/6;
}

.monthly-day:nth-of-type(7n + 7) {
grid-column: 7/7;
}

.monthly-day--disabled {
color: rgba(#98a0a6, 0.6);
background-color: #ffffff;
background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23f4f6f7' fill-opacity='1' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
}

.monthly-today {
border: 3px solid #f75959;
border-radius: 5px;
}

.monthly-task {
border-radius: 3px;
padding: 2px 8px 2px 6px;
margin: 3px 11px 0 9px;
font-size: 0.8em;
font-weight: 600;
position: relative;
z-index: 1;
color: #000;
overflow: hidden;
text-overflow: ellipsis;
height: 2vh;
}


@media (max-width: 767.98px) {
.monthly-task {
padding: 0px 8px 0px 4px;
margin: 3px 2px 0 4px;
}
}

.monthly-task-first {
align-self: start;
margin-top: 22px;
}

.monthly-task-second {
align-self: center;
margin-top: 8px;
}

.monthly-task-bottom {
align-self: end;
margin-bottom: 14px;
}

.monthly-more-tasks {
position: relative;
cursor: zoom-in;
align-self: end;
margin-top: 40px;
font-size: 0.6em;
font-weight: 600;
color: darkblue;
align-self: end;
margin-left: 10px;
}
22 changes: 12 additions & 10 deletions BlazorCalendar/WeekView.razor
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,30 @@

@for (var i = 0; i < 7; i++)
{
int d = Dates.GetNumOfDay(i);
DateTime day = FirstDateWeek.AddDays(i);

<div class="day-column" style="grid-column-start: @(i+1)">
@{
CSSbackground = GetBackground(day);
}
<div class="day-header header-name noselect" style="@HeaderStyle @CSSbackground">
@dayNames[i] @day.ToString("dd.MM")

<div class="day-header header-name noselect" style="@HeaderStyle">
@dayNames[d] @day.ToString("dd.MM")

</div>

<div class="hours">

@{
CSSbackground = GetBackground(day);
}
@for (int hour = 0; hour < 24; hour++)
{
DateTime hours = day.AddHours(hour);

<div class="hour day-cellule noselect"
ondragover="event.preventDefault();this.style.fontWeight='600';"
ondragover="event.preventDefault();this.style.fontWeight = '600';"
ondragleave="this.style.fontWeight='100';"
@ondrop:preventDefault="true"
@ondrop="() => HandleDayOnDrop(hours)"
@onclick="e => ClickDayInternal(e, hours)">
@onclick="e => ClickDayInternal(e, hours)"
style="@CSSbackground">
@hours.ToString("HH:mm")
</div>

Expand All @@ -71,7 +73,7 @@
classPin = string.IsNullOrWhiteSpace(t.Comment) ? null : " pin";
classPointer = " cursor-pointer";

<div class="@($"hour-task {classPin}{classPointer} border-top border-bottom")"
<div class="@($"hour-task {classPin}{classPointer} border-start border-top border-bottom")"
style="grid-column-start: @column; @taskColor"
draggable="@Draggable.ToString()"
@ondragstart="() => HandleDragStart(t.ID)"
Expand Down
5 changes: 4 additions & 1 deletion BlazorCalendar/WeekView.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
grid-area: 1 / 1 / span 1 / span 2;
}

.day-cellule:hover {
font-weight: 600;
}

.hours {
border: 1px solid #c6c6c6;
flex: 1;
Expand All @@ -26,7 +30,6 @@
padding-left: 0.5em;
}


.hour-task {
text-align: center;
font-size: 0.8em;
Expand Down
137 changes: 0 additions & 137 deletions BlazorCalendar/wwwroot/BlazorCalendar.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,146 +144,9 @@
border-color: transparent #9900ff transparent transparent;
}



/* MontlyView.razor */
.monthly-calendar {
display: grid;
width: 100%;
grid-template-rows: 6vh;
/*grid-template-columns: repeat(7, minmax(120px, 1fr));
grid-auto-rows: 120px;*/
grid-template-columns: repeat(7, minmax(8vw, 1fr));
grid-auto-rows: 12vh;
overflow: auto;
}

.monthly-day {
border-bottom: 1px solid rgba(166, 168, 179, 0.12);
border-right: 1px solid rgba(166, 168, 179, 0.12);
text-align: right;
padding: 0.4vh 0.4vw;
letter-spacing: 1px;
font-size: 0.8em;
box-sizing: border-box;
color: #6d7377;
position: relative;
}
.monthly-day:nth-of-type(n + 1):nth-of-type(-n + 7) {
grid-row: 2;
}

.monthly-day:nth-of-type(n + 8):nth-of-type(-n + 14) {
grid-row: 3;
}

.monthly-day:nth-of-type(n + 15):nth-of-type(-n + 21) {
grid-row: 4;
}

.monthly-day:nth-of-type(n + 22):nth-of-type(-n + 28) {
grid-row: 5;
}

.monthly-day:nth-of-type(n + 29):nth-of-type(-n + 35) {
grid-row: 6;
}

.monthly-day:nth-of-type(n + 36):nth-of-type(-n + 43) {
grid-row: 7;
}

.monthly-day:nth-of-type(7n + 1) {
grid-column: 1/1;
}

.monthly-day:nth-of-type(7n + 2) {
grid-column: 2/2;
}

.monthly-day:nth-of-type(7n + 3) {
grid-column: 3/3;
}

.monthly-day:nth-of-type(7n + 4) {
grid-column: 4/4;
}

.monthly-day:nth-of-type(7n + 5) {
grid-column: 5/5;
}

.monthly-day:nth-of-type(7n + 6) {
grid-column: 6/6;
}

.monthly-day:nth-of-type(7n + 7) {
grid-column: 7/7;
}

.monthly-day--disabled {
color: rgba(#98a0a6, 0.6);
background-color: #ffffff;
background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23f4f6f7' fill-opacity='1' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
}

.monthly-today {
border: 3px solid #f75959;
border-radius: 5px;
}

.monthly-task {
border-radius: 3px;
padding: 2px 8px 2px 6px;
margin: 3px 11px 0 9px;
font-size: 0.8em;
font-weight: 600;
position: relative;
z-index: 1;
color: #000;
overflow: hidden;
text-overflow: ellipsis;
height:2vh;
}

.border-start {
border-left-width: 3px !important;
border-left-style: solid !important;
border-left-color: #4d4d4d4c !important;
}

@media (max-width: 767.98px) {
.monthly-task {
padding: 0px 8px 0px 4px;
margin: 3px 2px 0 4px;
}
}

.monthly-task-first {
align-self: start;
margin-top: 22px;
}

.monthly-task-second {
align-self: center;
margin-top: 8px;
}

.monthly-task-bottom {
align-self: end;
margin-bottom: 14px;
}

.monthly-more-tasks {
position: relative;
cursor: zoom-in;
align-self: end;
margin-top: 40px;
font-size: 0.6em;
font-weight: 600;
color: darkblue;
align-self: end;
margin-left: 10px;
}


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Blazor-Calendar
[![NuGet](https://img.shields.io/nuget/v/BlazorCalendar.svg)](https://www.nuget.org/packages/BlazorCalendar/) ![BlazorCalendar Nuget Package](https://img.shields.io/nuget/dt/BlazorCalendar)

[![GitHub](https://img.shields.io/github/license/tossnet/Blazor-Calendar?color=594ae2&logo=github&style=flat-square)](https://github.com/tossnet/Blazor-Calendar/blob/main/LICENSE)

For Blazor Server or Blazor WebAssembly

Expand Down

0 comments on commit 507fdf8

Please sign in to comment.