Skip to content

Commit ba9f5ad

Browse files
committed
fix(month-view): use correct inflection of month names on the title
Fixes #757
1 parent c753c22 commit ba9f5ad

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

projects/angular-calendar/src/modules/common/calendar-angular-date-formatter.provider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class CalendarAngularDateFormatter
3333
* The month view title
3434
*/
3535
public monthViewTitle({ date, locale }: DateFormatterParams): string {
36-
return formatDate(date, 'MMMM y', locale);
36+
return formatDate(date, 'LLLL y', locale);
3737
}
3838

3939
/**

projects/angular-calendar/test/calendar-angular-date-formatter.provider.spec.ts

+13
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import { inject, TestBed } from '@angular/core/testing';
22
import { expect } from 'chai';
33
import { startOfDay } from 'date-fns';
4+
import localePl from '@angular/common/locales/pl';
45
import { CalendarAngularDateFormatter, DateAdapter } from '../src';
56
import { adapterFactory } from '../src/date-adapters/date-fns';
7+
import { registerLocaleData } from '@angular/common';
8+
9+
registerLocaleData(localePl);
610

711
describe('CalendarAngularDateFormatter provider', () => {
812
beforeEach(() => {
@@ -49,6 +53,15 @@ describe('CalendarAngularDateFormatter provider', () => {
4953
).to.equal('January 2016');
5054
});
5155

56+
it('monthViewTitle in polish', () => {
57+
expect(
58+
dateFormatter.monthViewTitle({
59+
date: new Date('2016-01-01'),
60+
locale: 'pl'
61+
})
62+
).to.equal('styczeń 2016');
63+
});
64+
5265
it('weekViewColumnHeader', () => {
5366
expect(
5467
dateFormatter.weekViewColumnHeader({

0 commit comments

Comments
 (0)