Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal mode : month localization not working #324

Open
AlexandreChollet opened this issue Apr 8, 2021 · 1 comment
Open

Modal mode : month localization not working #324

AlexandreChollet opened this issue Apr 8, 2021 · 1 comment

Comments

@AlexandreChollet
Copy link

Ionic version: (check one with "x")
[ ] 2.x
[ ] 3.x
[x] 4.x

Ion2-calendar mode: (check one with "x")
[ ] components mode
[x] modal mode

I'm submitting a ... (check one with "x")
[ ] bug report
[x] feature request
[ ] help me

Current behavior:
Localization is not available for months in modal mode.

Expected behavior:
Even when setting 'fr-FR' as localization in my app.module.ts, I cannot get the right month labels in the modal mode.
Why on earth isn't there customization not available, just like the weekdays option?

screenshot

Steps to reproduce:
Open modal.

Related code:

app.module.ts :

import { ErrorHandler, NgModule, LOCALE_ID } from '@angular/core';

@NgModule({
  [...]
  providers: [
    { provide: LOCALE_ID, useValue: "fr-FR" }
  ]
})

date-form.ts :

@Input()
calendarModalOptions: CalendarModalOptions;

setOptions() {
    this.calendarModalOptions.weekdays = ['Dim.', 'Lundi', 'Mardi', 'Mercr.', 'Jeudi', 'Vend.', 'Sam.'];
    this.calendarModalOptions.weekStart = 1;
    this.calendarModalOptions.closeIcon = true;
    this.calendarModalOptions.doneIcon = true;
    this.calendarModalOptions.monthFormat = 'MMMM YYYY';
}

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Ionic:

   ionic (Ionic CLI)  : 4.12.0
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.4

Cordova:

   cordova (Cordova CLI) : not installed
   Cordova Platforms     : not available
   Cordova Plugins       : not available

System:

   NodeJS : v12.18.4 (C:\Program Files\nodejs\node.exe)
   npm    : 6.14.6
   OS     : Windows 10

PS C:\Users\alexandre.chollet\Desktop\Projets\masante\ma-sante>
@JuanGalindoBM
Copy link

add this in yout app.component.ts

import * as moment from 'moment';
moment.locale('es');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants