Skip to content

Commit

Permalink
fix(calendar): show day in today's date (#899)
Browse files Browse the repository at this point in the history
  • Loading branch information
lexzhukov authored and nnixaa committed Oct 16, 2018
1 parent 08c2eb6 commit e023aa3
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { NbButtonModule } from '../button/button.module';
import { NbCalendarMonthModelService, NbDateService } from './services';

import {
NbCalendarDatePipe,
NbCalendarDayCellComponent,
NbCalendarDayPickerComponent,
NbCalendarDaysNamesComponent,
Expand Down Expand Up @@ -51,10 +50,6 @@ const COMPONENTS = [
NbCalendarPickerComponent,
];

const PIPES = [
NbCalendarDatePipe,
];

/**
* `NbCalendarKitModule` is a module that contains multiple useful components for building custom calendars.
* So if you think our calendars is not enough powerful for you just use calendar-kit and build your own calendar!
Expand All @@ -75,8 +70,8 @@ const PIPES = [
* */
@NgModule({
imports: [NbSharedModule, NbButtonModule],
exports: [...COMPONENTS, ...PIPES],
declarations: [...COMPONENTS, ...PIPES],
exports: [...COMPONENTS],
declarations: [...COMPONENTS],
providers: [...SERVICES],
entryComponents: [
NbCalendarDayCellComponent,
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { By } from '@angular/platform-browser';
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { NbDateService, NbNativeDateService } from '../../services';
import { NbCalendarDatePipe } from '../calendar-date/calendar-date.pipe';
import { NbCalendarHeaderComponent } from '../calendar-header/calendar-header.component';
import { NbThemeModule } from '../../../../theme.module';
import { DatePipe } from '@angular/common';
Expand All @@ -25,7 +24,7 @@ describe('Component: NbCalendarHeader', () => {
TestBed.configureTestingModule({
imports: [NbThemeModule.forRoot()],
providers: [{ provide: NbDateService, useClass: NbNativeDateService }, DatePipe],
declarations: [NbCalendarHeaderComponent, NbCalendarDatePipe],
declarations: [NbCalendarHeaderComponent],
});
fixture = TestBed.createComponent<NbCalendarHeaderComponent<Date>>(NbCalendarHeaderComponent);
component = fixture.componentInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { NbDateService } from '../../services';
template: `
<div class="header">
<span class="title" (click)="navigateToday.emit()">
{{ date | nbCalendarDate }}
{{ date | date: 'mediumDate' }}
<i [ngClass]="{ 'nb-arrow-dropright': isLtr, 'nb-arrow-dropleft': isRtl }"></i>
</span>
<span class="sub-title">Today</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

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

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

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [NbCalendarDatePipe, NbCalendarNavigationComponent],
declarations: [NbCalendarNavigationComponent],
providers: [{ provide: NbDateService, useClass: NbNativeDateService }, DatePipe],
});
fixture = TestBed.createComponent<NbCalendarNavigationComponent<Date>>(NbCalendarNavigationComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from
`],
template: `
<button nbButton (click)="changeMode.emit()">
{{ date | nbCalendarDate }}
{{ date | date: 'MMM yyyy' }}
</button>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

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

import { NbCalendarDatePipe } from '../calendar-date/calendar-date.pipe';
import { NbCalendarNavigationComponent } from './calendar-navigation.component';
import { NbCalendarPageableNavigationComponent } from './calendar-pageable-navigation.component';
import { NbDateService, NbNativeDateService } from '../../services';
Expand All @@ -22,7 +21,7 @@ describe('Component: NbCalendarPageableNavigation', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [NbThemeModule.forRoot()],
declarations: [NbCalendarDatePipe, NbCalendarNavigationComponent, NbCalendarPageableNavigationComponent],
declarations: [NbCalendarNavigationComponent, NbCalendarPageableNavigationComponent],
providers: [{ provide: NbDateService, useClass: NbNativeDateService }, DatePipe],
});
fixture =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ export { NbCalendarMonthCellComponent } from './calendar-month-picker/calendar-m
export { NbCalendarYearCellComponent } from './calendar-year-picker/calendar-year-cell.component';
export { NbCalendarPickerRowComponent } from './calendar-picker/calendar-picker-row.component';
export { NbCalendarPickerComponent }from './calendar-picker/calendar-picker.component';
export { NbCalendarDatePipe } from './calendar-date/calendar-date.pipe';

0 comments on commit e023aa3

Please sign in to comment.