Skip to content

Commit e023aa3

Browse files
azhukau-devnnixaa
authored andcommitted
fix(calendar): show day in today's date (#899)
1 parent 08c2eb6 commit e023aa3

File tree

9 files changed

+7
-71
lines changed

9 files changed

+7
-71
lines changed

src/framework/theme/components/calendar-kit/calendar-kit.module.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { NbButtonModule } from '../button/button.module';
1313
import { NbCalendarMonthModelService, NbDateService } from './services';
1414

1515
import {
16-
NbCalendarDatePipe,
1716
NbCalendarDayCellComponent,
1817
NbCalendarDayPickerComponent,
1918
NbCalendarDaysNamesComponent,
@@ -51,10 +50,6 @@ const COMPONENTS = [
5150
NbCalendarPickerComponent,
5251
];
5352

54-
const PIPES = [
55-
NbCalendarDatePipe,
56-
];
57-
5853
/**
5954
* `NbCalendarKitModule` is a module that contains multiple useful components for building custom calendars.
6055
* So if you think our calendars is not enough powerful for you just use calendar-kit and build your own calendar!
@@ -75,8 +70,8 @@ const PIPES = [
7570
* */
7671
@NgModule({
7772
imports: [NbSharedModule, NbButtonModule],
78-
exports: [...COMPONENTS, ...PIPES],
79-
declarations: [...COMPONENTS, ...PIPES],
73+
exports: [...COMPONENTS],
74+
declarations: [...COMPONENTS],
8075
providers: [...SERVICES],
8176
entryComponents: [
8277
NbCalendarDayCellComponent,

src/framework/theme/components/calendar-kit/components/calendar-date/calendar-date.pipe.spec.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/framework/theme/components/calendar-kit/components/calendar-date/calendar-date.pipe.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/framework/theme/components/calendar-kit/components/calendar-header/calendar-header.component.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { By } from '@angular/platform-browser';
99
import { ComponentFixture, TestBed } from '@angular/core/testing';
1010

1111
import { NbDateService, NbNativeDateService } from '../../services';
12-
import { NbCalendarDatePipe } from '../calendar-date/calendar-date.pipe';
1312
import { NbCalendarHeaderComponent } from '../calendar-header/calendar-header.component';
1413
import { NbThemeModule } from '../../../../theme.module';
1514
import { DatePipe } from '@angular/common';
@@ -25,7 +24,7 @@ describe('Component: NbCalendarHeader', () => {
2524
TestBed.configureTestingModule({
2625
imports: [NbThemeModule.forRoot()],
2726
providers: [{ provide: NbDateService, useClass: NbNativeDateService }, DatePipe],
28-
declarations: [NbCalendarHeaderComponent, NbCalendarDatePipe],
27+
declarations: [NbCalendarHeaderComponent],
2928
});
3029
fixture = TestBed.createComponent<NbCalendarHeaderComponent<Date>>(NbCalendarHeaderComponent);
3130
component = fixture.componentInstance;

src/framework/theme/components/calendar-kit/components/calendar-header/calendar-header.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { NbDateService } from '../../services';
1515
template: `
1616
<div class="header">
1717
<span class="title" (click)="navigateToday.emit()">
18-
{{ date | nbCalendarDate }}
18+
{{ date | date: 'mediumDate' }}
1919
<i [ngClass]="{ 'nb-arrow-dropright': isLtr, 'nb-arrow-dropleft': isRtl }"></i>
2020
</span>
2121
<span class="sub-title">Today</span>

src/framework/theme/components/calendar-kit/components/calendar-navigation/calendar-navigation.component.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import { ComponentFixture, TestBed } from '@angular/core/testing';
88

99
import { NbCalendarNavigationComponent } from './calendar-navigation.component';
10-
import { NbCalendarDatePipe } from '../calendar-date/calendar-date.pipe';
1110
import { NbDateService, NbNativeDateService } from '../../services';
1211
import { DatePipe } from '@angular/common';
1312

@@ -19,7 +18,7 @@ describe('Component: NbCalendarNavigation', () => {
1918

2019
beforeEach(() => {
2120
TestBed.configureTestingModule({
22-
declarations: [NbCalendarDatePipe, NbCalendarNavigationComponent],
21+
declarations: [NbCalendarNavigationComponent],
2322
providers: [{ provide: NbDateService, useClass: NbNativeDateService }, DatePipe],
2423
});
2524
fixture = TestBed.createComponent<NbCalendarNavigationComponent<Date>>(NbCalendarNavigationComponent);

src/framework/theme/components/calendar-kit/components/calendar-navigation/calendar-navigation.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from
2121
`],
2222
template: `
2323
<button nbButton (click)="changeMode.emit()">
24-
{{ date | nbCalendarDate }}
24+
{{ date | date: 'MMM yyyy' }}
2525
</button>
2626
`,
2727
changeDetection: ChangeDetectionStrategy.OnPush,

src/framework/theme/components/calendar-kit/components/calendar-navigation/calendar-pageable-navigation.component.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import { ComponentFixture, TestBed } from '@angular/core/testing';
88

9-
import { NbCalendarDatePipe } from '../calendar-date/calendar-date.pipe';
109
import { NbCalendarNavigationComponent } from './calendar-navigation.component';
1110
import { NbCalendarPageableNavigationComponent } from './calendar-pageable-navigation.component';
1211
import { NbDateService, NbNativeDateService } from '../../services';
@@ -22,7 +21,7 @@ describe('Component: NbCalendarPageableNavigation', () => {
2221
beforeEach(() => {
2322
TestBed.configureTestingModule({
2423
imports: [NbThemeModule.forRoot()],
25-
declarations: [NbCalendarDatePipe, NbCalendarNavigationComponent, NbCalendarPageableNavigationComponent],
24+
declarations: [NbCalendarNavigationComponent, NbCalendarPageableNavigationComponent],
2625
providers: [{ provide: NbDateService, useClass: NbNativeDateService }, DatePipe],
2726
});
2827
fixture =

src/framework/theme/components/calendar-kit/components/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ export { NbCalendarMonthCellComponent } from './calendar-month-picker/calendar-m
1616
export { NbCalendarYearCellComponent } from './calendar-year-picker/calendar-year-cell.component';
1717
export { NbCalendarPickerRowComponent } from './calendar-picker/calendar-picker-row.component';
1818
export { NbCalendarPickerComponent }from './calendar-picker/calendar-picker.component';
19-
export { NbCalendarDatePipe } from './calendar-date/calendar-date.pipe';

0 commit comments

Comments
 (0)