Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3719 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3719 Rev 3741
Línea 68... Línea 68...
68
 
68
 
69
  return '';
69
  return '';
Línea 70... Línea 70...
70
};
70
};
71
 
71
 
Línea 72... Línea 72...
72
export const formatDate = (date) => {
72
export const formatDate = (date) => {
-
 
73
  const now = new Date();
-
 
74
 
-
 
75
  if (!date || isNaN(new Date(date))) {
-
 
76
    return now.toLocaleString('es-ES', {
73
  const dateObj = new Date(date);
77
      dateStyle: 'medium',
-
 
78
      timeStyle: 'short',
74
 
79
      timeZone: 'UTC',
Línea 75... Línea 80...
75
  if (isNaN(dateObj)) {
80
      hour12: true
76
    return date;
81
    });
77
  }
82
  }
78
 
83
 
79
  return new Intl.DateTimeFormat('es', {
84
  return new Intl.DateTimeFormat('es', {
80
    dateStyle: 'medium',
85
    dateStyle: 'medium',
81
    timeStyle: 'short',
86
    timeStyle: 'short',