Describe the bug
Hi,
I am trying to change the calendar language to italian and change format date in dd-mm-yyyy.
I tried changing the local string from eng to it in the calendar-header-component
export class CalendarHeaderComponent {
@Input() view: string;
@Input() viewDate: Date;
@Input() locale: string = 'it';
@Output() viewChange: EventEmitter
@Output() viewDateChange: EventEmitter
}
but still nothing is changing, am I missing something?
On the format date, I am not understanding how to use the CalendarDateFormatter class properly
Minimal reproduction of the problem with instructions
Screenshots
Versions:
@angular/core: Angular: 5.2.11angular-calendar : angular 5.0+ calendarYou have a section of the demo about the I18N : https://mattlewis92.github.io/angular-calendar/#/i18n
You will need to add some code in your module.ts
import { registerLocaleData } from '@angular/common';
import localeFr from '@angular/common/locales/fr';
[...]
registerLocaleData(localeFr);
[...]
About the formater, i don't really know how to use it but here is my working solution for the moment :laughing:
import { CalendarDateFormatter, CalendarEvent, CalendarEventAction, DAYS_OF_WEEK } from 'angular-calendar';
[...]
@Component({
templateUrl: 'test.component.html',
selector: 'app-test',
styleUrls: ['test.component.scss'],
providers: [
{
provide: CalendarDateFormatter,
useClass: CalendarDateFormatter
}
]
})
[...]
@RignonNoel is on the right track with this, these 2 demos should give you what you need:
https://mattlewis92.github.io/angular-calendar/#/i18n
https://mattlewis92.github.io/angular-calendar/#/customise-date-formats
Most helpful comment
@RignonNoel is on the right track with this, these 2 demos should give you what you need:
https://mattlewis92.github.io/angular-calendar/#/i18n
https://mattlewis92.github.io/angular-calendar/#/customise-date-formats