Skip to content

Commit

Permalink
chore: add calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaZhem committed Aug 14, 2024
1 parent d7c04c1 commit ae5d693
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,11 @@ <h3 tuiTitle>
</div>
}
</div>
<tui-calendar
class="calendar"
[value]="calendarValue"
(dayClick)="onDayClick($event)"
/>
@if (calendarValue) {
<div>Chosen date: {{ calendarValue }}</div>
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
}
}

.calendar {
@media (max-width: 43.75rem) {
margin-left: auto;
margin-right: auto;
}
}

.card-animals[tuiAppearance][data-appearance='whiteblock'] {
display: flex;
flex-direction: row;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {AsyncPipe, CommonModule} from '@angular/common';
import {ChangeDetectionStrategy, Component, EventEmitter, Output} from '@angular/core';
import {TuiPieChart} from '@taiga-ui/addon-charts';
import {TuiAmountPipe} from '@taiga-ui/addon-commerce';
import {TuiAppearance, TuiButton, TuiHint, TuiTitle} from '@taiga-ui/core';
import type {TuiDay} from '@taiga-ui/cdk';
import {TuiAppearance, TuiButton, TuiCalendar, TuiHint, TuiTitle} from '@taiga-ui/core';
import {TuiAvatar, TuiBadge, TuiStatus} from '@taiga-ui/kit';
import {TuiCardLarge, TuiHeader} from '@taiga-ui/layout';

Expand All @@ -17,6 +18,7 @@ import {TuiCardLarge, TuiHeader} from '@taiga-ui/layout';
TuiAvatar,
TuiBadge,
TuiButton,
TuiCalendar,
TuiCardLarge,
TuiHeader,
TuiHint,
Expand All @@ -31,6 +33,8 @@ import {TuiCardLarge, TuiHeader} from '@taiga-ui/layout';
export class AdministratorComponent {
protected readonly value = [13769, 12367, 10172, 3018, 2592];
protected readonly labels = ['Food', 'Сleaning', 'Electricity', 'Water', 'Other'];
protected calendarValue: TuiDay | null = null;

protected animals = [
{
src: './nft/1.jpg',
Expand Down Expand Up @@ -64,4 +68,8 @@ export class AdministratorComponent {
protected openTable(): void {
this.openTableChange.emit(true);
}

protected onDayClick(day: TuiDay): void {
this.calendarValue = day;
}
}

0 comments on commit ae5d693

Please sign in to comment.