Skip to content
This repository was archived by the owner on Mar 4, 2023. It is now read-only.

Commit 5f8e5e4

Browse files
author
evombau
committed
bugfixes + get Date by click | v1.0.0
1 parent ba2bc20 commit 5f8e5e4

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ and you are good to go ;)
4343

4444
>If only a one-month layout is required, the following tag can also be used:
4545
>``` html
46-
><calendar-panel [placeholderDay]="placeholder" year="2020" month="5" [config]="calendarConfig">
46+
><calendar-panel [placeholderDay]="placeholder" year="2020" month="5" [config]="calendarConfig" (clickDate)="yourMethod($event)">
4747
></calendar-panel>
4848
>```
4949
>.
@@ -59,7 +59,8 @@ All options are shown here:
5959
month="3"
6060
monthsBefore="1"
6161
monthsAfter="1"
62-
[config]="calendarConfig">
62+
[config]="calendarConfig"
63+
(clickDate)="yourMethod($event)">
6364
</calendar-panels>
6465
<!--
6566
default placeholderDay = false
@@ -112,6 +113,11 @@ calendarConfig: CalendarConfig = {
112113

113114
and many more...
114115

116+
## Features
117+
118+
- generate a nice calendar in material design
119+
- get a date back with the annotation "clickDate" (see example)
120+
115121
## Code scaffolding
116122

117123
For code scaffolding, the project can be checked out from the public repository and pull requests can be made.

projects/material-calendar/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ and you are good to go ;)
4343

4444
>If only a one-month layout is required, the following tag can also be used:
4545
>``` html
46-
><calendar-panel [placeholderDay]="placeholder" year="2020" month="5" [config]="calendarConfig">
46+
><calendar-panel [placeholderDay]="placeholder" year="2020" month="5" [config]="calendarConfig" (clickDate)="yourMethod($event)">
4747
></calendar-panel>
4848
>```
4949
>.
@@ -59,7 +59,8 @@ All options are shown here:
5959
month="3"
6060
monthsBefore="1"
6161
monthsAfter="1"
62-
[config]="calendarConfig">
62+
[config]="calendarConfig"
63+
(clickDate)="yourMethod($event)">
6364
</calendar-panels>
6465
<!--
6566
default placeholderDay = false
@@ -112,6 +113,11 @@ calendarConfig: CalendarConfig = {
112113

113114
and many more...
114115

116+
## Features
117+
118+
- generate a nice calendar in material design
119+
- get a date back with the annotation "clickDate" (see example)
120+
115121
## Code scaffolding
116122

117123
For code scaffolding, the project can be checked out from the public repository and pull requests can be made.

projects/material-calendar/src/lib/calendar-panel/calendar-panel.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ <h3 class="displayMonthName" *ngIf="config.displayYear">{{monat.name}} {{monat.y
3131
<a>{{day.day}}</a>
3232
</mat-grid-tile>
3333

34-
<mat-grid-tile *ngIf="day.type === 'date'" colspan="1" rowspan="1" matTooltip="test" class="date"
34+
<mat-grid-tile (click)="onClick(day)" *ngIf="day.type === 'date'" colspan="1" rowspan="1" matTooltip="test" class="date"
3535
[ngClass]="[day.isWeekendDay? 'Weekend' : '', day.isHoliday && config.useHolidays ? 'Holiday' : '']">
36-
<div (click)="onClick(day)" [ngClass]="day.date.setHours(0, 0, 0, 0) == today? 'today': ''">
36+
<div [ngClass]="day.date.setHours(0, 0, 0, 0) == today? 'today': ''">
3737
<a>{{day.day}}</a>
3838
</div>
3939
</mat-grid-tile>

projects/material-calendar/src/lib/calendar-panels/calendar-panels.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ <h3 class="displayMonthName" *ngIf="config.displayYear">{{monat.name}} {{monat.y
4444
<a>{{day.day}}</a>
4545
</mat-grid-tile>
4646

47-
<mat-grid-tile *ngIf="day.type === 'date'" colspan="1" rowspan="1" matTooltip="test" class="date"
47+
<mat-grid-tile (click)="onClick(day)" *ngIf="day.type === 'date'" colspan="1" rowspan="1" matTooltip="test" class="date"
4848
[ngClass]="[day.isWeekendDay? 'Weekend' : '', day.isHoliday && config.useHolidays ? 'Holiday' : '']">
49-
<div (click)="onClick(day)" [ngClass]="day.date.setHours(0, 0, 0, 0) == today? 'today': ''">
49+
<div [ngClass]="day.date.setHours(0, 0, 0, 0) == today? 'today': ''">
5050
<a>{{day.day}}</a>
5151
</div>
5252
</mat-grid-tile>

0 commit comments

Comments
 (0)