import 'package:easy_localization/easy_localization.dart';

String formatDate(DateTime date, String locale) {
  final formatter =
  DateFormat('EEEE, d \'de\' MMMM \'del\' y', locale);
  String formattedDate = formatter.format(date);
  formattedDate =
      formattedDate.replaceRange(0, 1, formattedDate[0].toUpperCase());
  formattedDate = formattedDate.replaceRange(
      formattedDate.indexOf(' de ') + 4,
      formattedDate.indexOf(' de ') + 5,
      formattedDate[formattedDate.indexOf(' de ') + 4].toUpperCase());

  return formattedDate;
}
