Skip to content

Commit 507fdf8

Browse files
author
Christophe Peugnet
committed
add dotnet 9
2 parents 80b3915 + 0abb543 commit 507fdf8

File tree

6 files changed

+153
-150
lines changed

6 files changed

+153
-150
lines changed

BlazorCalendar/MonthlyView.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
if (TasksList is not null)
2222
{
2323
TasksList = TasksList.OrderBy(x => x.DateStart)
24-
.ThenByDescending(x => x.DateEnd).ToArray();
24+
.ThenByDescending(x => x.DateEnd)
25+
.ToArray();
2526
}
2627
}
2728

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
.monthly-calendar {
2+
display: grid;
3+
width: 100%;
4+
grid-template-rows: 6vh;
5+
/*grid-template-columns: repeat(7, minmax(120px, 1fr));
6+
grid-auto-rows: 120px;*/
7+
grid-template-columns: repeat(7, minmax(8vw, 1fr));
8+
grid-auto-rows: 12vh;
9+
overflow: auto;
10+
}
11+
12+
.monthly-day {
13+
border-bottom: 1px solid rgba(166, 168, 179, 0.12);
14+
border-right: 1px solid rgba(166, 168, 179, 0.12);
15+
text-align: right;
16+
padding: 0.4vh 0.4vw;
17+
letter-spacing: 1px;
18+
font-size: 0.8em;
19+
box-sizing: border-box;
20+
color: #6d7377;
21+
position: relative;
22+
}
23+
24+
.monthly-day:nth-of-type(n + 1):nth-of-type(-n + 7) {
25+
grid-row: 2;
26+
}
27+
28+
.monthly-day:nth-of-type(n + 8):nth-of-type(-n + 14) {
29+
grid-row: 3;
30+
}
31+
32+
.monthly-day:nth-of-type(n + 15):nth-of-type(-n + 21) {
33+
grid-row: 4;
34+
}
35+
36+
.monthly-day:nth-of-type(n + 22):nth-of-type(-n + 28) {
37+
grid-row: 5;
38+
}
39+
40+
.monthly-day:nth-of-type(n + 29):nth-of-type(-n + 35) {
41+
grid-row: 6;
42+
}
43+
44+
.monthly-day:nth-of-type(n + 36):nth-of-type(-n + 43) {
45+
grid-row: 7;
46+
}
47+
48+
.monthly-day:nth-of-type(7n + 1) {
49+
grid-column: 1/1;
50+
}
51+
52+
.monthly-day:nth-of-type(7n + 2) {
53+
grid-column: 2/2;
54+
}
55+
56+
.monthly-day:nth-of-type(7n + 3) {
57+
grid-column: 3/3;
58+
}
59+
60+
.monthly-day:nth-of-type(7n + 4) {
61+
grid-column: 4/4;
62+
}
63+
64+
.monthly-day:nth-of-type(7n + 5) {
65+
grid-column: 5/5;
66+
}
67+
68+
.monthly-day:nth-of-type(7n + 6) {
69+
grid-column: 6/6;
70+
}
71+
72+
.monthly-day:nth-of-type(7n + 7) {
73+
grid-column: 7/7;
74+
}
75+
76+
.monthly-day--disabled {
77+
color: rgba(#98a0a6, 0.6);
78+
background-color: #ffffff;
79+
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");
80+
}
81+
82+
.monthly-today {
83+
border: 3px solid #f75959;
84+
border-radius: 5px;
85+
}
86+
87+
.monthly-task {
88+
border-radius: 3px;
89+
padding: 2px 8px 2px 6px;
90+
margin: 3px 11px 0 9px;
91+
font-size: 0.8em;
92+
font-weight: 600;
93+
position: relative;
94+
z-index: 1;
95+
color: #000;
96+
overflow: hidden;
97+
text-overflow: ellipsis;
98+
height: 2vh;
99+
}
100+
101+
102+
@media (max-width: 767.98px) {
103+
.monthly-task {
104+
padding: 0px 8px 0px 4px;
105+
margin: 3px 2px 0 4px;
106+
}
107+
}
108+
109+
.monthly-task-first {
110+
align-self: start;
111+
margin-top: 22px;
112+
}
113+
114+
.monthly-task-second {
115+
align-self: center;
116+
margin-top: 8px;
117+
}
118+
119+
.monthly-task-bottom {
120+
align-self: end;
121+
margin-bottom: 14px;
122+
}
123+
124+
.monthly-more-tasks {
125+
position: relative;
126+
cursor: zoom-in;
127+
align-self: end;
128+
margin-top: 40px;
129+
font-size: 0.6em;
130+
font-weight: 600;
131+
color: darkblue;
132+
align-self: end;
133+
margin-left: 10px;
134+
}

BlazorCalendar/WeekView.razor

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,30 @@
2727

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

3233
<div class="day-column" style="grid-column-start: @(i+1)">
33-
@{
34-
CSSbackground = GetBackground(day);
35-
}
36-
<div class="day-header header-name noselect" style="@HeaderStyle @CSSbackground">
37-
@dayNames[i] @day.ToString("dd.MM")
34+
35+
<div class="day-header header-name noselect" style="@HeaderStyle">
36+
@dayNames[d] @day.ToString("dd.MM")
37+
3838
</div>
3939

4040
<div class="hours">
41-
41+
@{
42+
CSSbackground = GetBackground(day);
43+
}
4244
@for (int hour = 0; hour < 24; hour++)
4345
{
4446
DateTime hours = day.AddHours(hour);
45-
4647
<div class="hour day-cellule noselect"
47-
ondragover="event.preventDefault();this.style.fontWeight='600';"
48+
ondragover="event.preventDefault();this.style.fontWeight = '600';"
4849
ondragleave="this.style.fontWeight='100';"
4950
@ondrop:preventDefault="true"
5051
@ondrop="() => HandleDayOnDrop(hours)"
51-
@onclick="e => ClickDayInternal(e, hours)">
52+
@onclick="e => ClickDayInternal(e, hours)"
53+
style="@CSSbackground">
5254
@hours.ToString("HH:mm")
5355
</div>
5456

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

74-
<div class="@($"hour-task {classPin}{classPointer} border-top border-bottom")"
76+
<div class="@($"hour-task {classPin}{classPointer} border-start border-top border-bottom")"
7577
style="grid-column-start: @column; @taskColor"
7678
draggable="@Draggable.ToString()"
7779
@ondragstart="() => HandleDragStart(t.ID)"

BlazorCalendar/WeekView.razor.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
grid-area: 1 / 1 / span 1 / span 2;
1414
}
1515

16+
.day-cellule:hover {
17+
font-weight: 600;
18+
}
19+
1620
.hours {
1721
border: 1px solid #c6c6c6;
1822
flex: 1;
@@ -26,7 +30,6 @@
2630
padding-left: 0.5em;
2731
}
2832

29-
3033
.hour-task {
3134
text-align: center;
3235
font-size: 0.8em;

BlazorCalendar/wwwroot/BlazorCalendar.css

Lines changed: 0 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -144,146 +144,9 @@
144144
border-color: transparent #9900ff transparent transparent;
145145
}
146146

147-
148-
149-
/* MontlyView.razor */
150-
.monthly-calendar {
151-
display: grid;
152-
width: 100%;
153-
grid-template-rows: 6vh;
154-
/*grid-template-columns: repeat(7, minmax(120px, 1fr));
155-
grid-auto-rows: 120px;*/
156-
grid-template-columns: repeat(7, minmax(8vw, 1fr));
157-
grid-auto-rows: 12vh;
158-
overflow: auto;
159-
}
160-
161-
.monthly-day {
162-
border-bottom: 1px solid rgba(166, 168, 179, 0.12);
163-
border-right: 1px solid rgba(166, 168, 179, 0.12);
164-
text-align: right;
165-
padding: 0.4vh 0.4vw;
166-
letter-spacing: 1px;
167-
font-size: 0.8em;
168-
box-sizing: border-box;
169-
color: #6d7377;
170-
position: relative;
171-
}
172-
.monthly-day:nth-of-type(n + 1):nth-of-type(-n + 7) {
173-
grid-row: 2;
174-
}
175-
176-
.monthly-day:nth-of-type(n + 8):nth-of-type(-n + 14) {
177-
grid-row: 3;
178-
}
179-
180-
.monthly-day:nth-of-type(n + 15):nth-of-type(-n + 21) {
181-
grid-row: 4;
182-
}
183-
184-
.monthly-day:nth-of-type(n + 22):nth-of-type(-n + 28) {
185-
grid-row: 5;
186-
}
187-
188-
.monthly-day:nth-of-type(n + 29):nth-of-type(-n + 35) {
189-
grid-row: 6;
190-
}
191-
192-
.monthly-day:nth-of-type(n + 36):nth-of-type(-n + 43) {
193-
grid-row: 7;
194-
}
195-
196-
.monthly-day:nth-of-type(7n + 1) {
197-
grid-column: 1/1;
198-
}
199-
200-
.monthly-day:nth-of-type(7n + 2) {
201-
grid-column: 2/2;
202-
}
203-
204-
.monthly-day:nth-of-type(7n + 3) {
205-
grid-column: 3/3;
206-
}
207-
208-
.monthly-day:nth-of-type(7n + 4) {
209-
grid-column: 4/4;
210-
}
211-
212-
.monthly-day:nth-of-type(7n + 5) {
213-
grid-column: 5/5;
214-
}
215-
216-
.monthly-day:nth-of-type(7n + 6) {
217-
grid-column: 6/6;
218-
}
219-
220-
.monthly-day:nth-of-type(7n + 7) {
221-
grid-column: 7/7;
222-
}
223-
224-
.monthly-day--disabled {
225-
color: rgba(#98a0a6, 0.6);
226-
background-color: #ffffff;
227-
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");
228-
}
229-
230-
.monthly-today {
231-
border: 3px solid #f75959;
232-
border-radius: 5px;
233-
}
234-
235-
.monthly-task {
236-
border-radius: 3px;
237-
padding: 2px 8px 2px 6px;
238-
margin: 3px 11px 0 9px;
239-
font-size: 0.8em;
240-
font-weight: 600;
241-
position: relative;
242-
z-index: 1;
243-
color: #000;
244-
overflow: hidden;
245-
text-overflow: ellipsis;
246-
height:2vh;
247-
}
248-
249147
.border-start {
250148
border-left-width: 3px !important;
251149
border-left-style: solid !important;
252150
border-left-color: #4d4d4d4c !important;
253151
}
254152

255-
@media (max-width: 767.98px) {
256-
.monthly-task {
257-
padding: 0px 8px 0px 4px;
258-
margin: 3px 2px 0 4px;
259-
}
260-
}
261-
262-
.monthly-task-first {
263-
align-self: start;
264-
margin-top: 22px;
265-
}
266-
267-
.monthly-task-second {
268-
align-self: center;
269-
margin-top: 8px;
270-
}
271-
272-
.monthly-task-bottom {
273-
align-self: end;
274-
margin-bottom: 14px;
275-
}
276-
277-
.monthly-more-tasks {
278-
position: relative;
279-
cursor: zoom-in;
280-
align-self: end;
281-
margin-top: 40px;
282-
font-size: 0.6em;
283-
font-weight: 600;
284-
color: darkblue;
285-
align-self: end;
286-
margin-left: 10px;
287-
}
288-
289-

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Blazor-Calendar
22
[![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)
3-
3+
[![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)
44

55
For Blazor Server or Blazor WebAssembly
66

0 commit comments

Comments
 (0)