79378453

Date: 2025-01-22 16:09:15
Score: 1
Natty:
Report link

I solved my issue by following the steps described in this StackOverflow question (https://stackoverflow.com/questions/79314545/how-to-change-the-language-in-primeng-version-19#:~:text=How%20can%20I%20do%20this%20in%20Angular%2FPrimeng%2019%3F,needs%20this.primeNGConfig.setTranslation%28localeFr%29%3B%20%2F%2F%20French%20%2F%2F%20this.primeNGConfig.setTranslation%28localeEs%29%3B%20%2F%2F%20Spanish), which focuses on PrimeNG 19.0. Here's what I did:

Final code setup

import { it } from 'primelocale/it.json';
//...other imports


export const appConfig: ApplicationConfig = {
  providers: [
    //some global providers
   providePrimeNG({
      ripple: true,
      translation: it,
      theme: {
        preset: MyBeautifulPreset,
        options: {
          prefix: 'p',
          darkModeSelector: 'system',
          cssLayer: false,
        },
      },
    }),
    ...other providers...
 ]

And my date picker component:

<p-datepicker
    formControlName="minDate"
    inputId="minDate"
    showIcon
    inline
    [maxDate]="maxDate"
    [showButtonBar]="true"
  />
Reasons:
  • Blacklisted phrase (1): StackOverflow
  • Blacklisted phrase (1): stackoverflow
  • Whitelisted phrase (-2): I solved
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Enrico Arnaudo