File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/app/pages/configuracion Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1- import { Component } from '@angular/core' ;
1+ import { Component , LOCALE_ID } from '@angular/core' ;
22import { FormsModule } from '@angular/forms' ;
33import { PDFDocument , rgb , StandardFonts } from 'pdf-lib' ;
44import { DomSanitizer , SafeResourceUrl } from '@angular/platform-browser' ;
55import moment from 'moment' ;
6+ import 'moment/locale/es' ;
67import { DatePipe , registerLocaleData } from '@angular/common' ;
78import localeEs from '@angular/common/locales/es' ;
89
@@ -49,6 +50,9 @@ export interface FechaEspecial {
4950 FormsModule ,
5051 DatePipe
5152 ] ,
53+ providers : [
54+ { provide : LOCALE_ID , useValue : 'es' }
55+ ] ,
5256 templateUrl : './configuracion.html' ,
5357 styleUrl : './configuracion.scss'
5458} )
@@ -74,8 +78,9 @@ export class Configuracion {
7478 }
7579
7680 formatearFechaEspanol ( fecha : string ) : string {
77- // Asegura que moment use el locale español para el mes
78- return moment ( fecha ) . locale ( 'es' ) . format ( 'DD [de] MMMM [de] YYYY' ) ;
81+ // Configurar moment a español y formatear
82+ moment . locale ( 'es' ) ;
83+ return moment ( fecha ) . format ( 'DD [de] MMMM [de] YYYY' ) ;
7984 }
8085
8186 contarDiasEspeciales ( ) : number {
You can’t perform that action at this time.
0 commit comments