Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript][Angular2] Datepicker po PL, jak usawić datepicker wg LOCALE_ID?
poczatkujaca12
post
Post #1





Grupa: Zarejestrowani
Postów: 107
Pomógł: 0
Dołączył: 24.06.2010
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


mam w kodzie (template, html):
  1. <input class="form-control" placeholder="yyyy-mm-dd" i18n-placeholder name="od" required id="od" [(ngModel)]="model" ngbDatepicker #d="ngbDatepicker" (click)="d.toggle()" />


w app.modules.ts:

  1. import { LOCALE_ID, NgModule } from '@angular/core';
  2.  
  3. import { registerLocaleData } from '@angular/common';
  4. import localePl from '@angular/common/locales/pl';
  5. import localePlExtra from '@angular/common/locales/extra/pl'
  6.  
  7. providers: [
  8. { provide: LOCALE_ID, useValue: 'pl' }


jak ustawić aby datepicker był po Polsku (lub w języku przeglądarki użytkownika)?

Ten post edytował poczatkujaca12 5.12.2017, 14:39:09
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




https://ng-bootstrap.github.io/#/components...picker/examples
Przyklad
Internationalization of datepickers
nie dziala?
Go to the top of the page
+Quote Post
poczatkujaca12
post
Post #3





Grupa: Zarejestrowani
Postów: 107
Pomógł: 0
Dołączył: 24.06.2010
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


Tak mam zrobione w komponencie...
ale to wymaga osobnego tłumaczenia w osobnym miejscu a chcemy to zrobić w jednym miejscu na całą aplikację

Ten post edytował poczatkujaca12 6.12.2017, 09:34:48
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 17:56